From 2369e6ffda820e2b72bbef7b48e9115652bd73a1 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 11:27:16 +0200 Subject: [PATCH 01/23] Exclude defect when the status is "Not a defect" or "Justified" --- src/mlx/warnings/polyspace_checker.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index d7ec3c97..aafe57b9 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -258,13 +258,17 @@ def check(self, content): content (dict): The row of the TSV file ''' if content[self.column_name].lower() == self.check_value: - tab_sep_string = "\t".join(content.values()) - if not self._is_excluded(tab_sep_string): - self.count = self.count + 1 - self.counted_warnings.append('family: {} -> {}: {}'.format( - self.family_value, - self.column_name, - self.check_value - )) - if self.cq_enabled and content["color"].lower() != "green": - self.add_code_quality_finding(content) + if content["status"].lower() in ["not a defect", "justified"]: + self.print_when_verbose("Excluded row {!r} because the status is 'Not a defect' or 'Justified'" + .format(content)) + else: + tab_sep_string = "\t".join(content.values()) + if not self._is_excluded(tab_sep_string): + self.count = self.count + 1 + self.counted_warnings.append('family: {} -> {}: {}'.format( + self.family_value, + self.column_name, + self.check_value + )) + if self.cq_enabled and content["color"].lower() != "green": + self.add_code_quality_finding(content) From f3ddb519482d676695e12b26e2f919e684a2fb91 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 11:37:44 +0200 Subject: [PATCH 02/23] Indent .format --- src/mlx/warnings/polyspace_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index aafe57b9..0312fa3e 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -260,7 +260,7 @@ def check(self, content): if content[self.column_name].lower() == self.check_value: if content["status"].lower() in ["not a defect", "justified"]: self.print_when_verbose("Excluded row {!r} because the status is 'Not a defect' or 'Justified'" - .format(content)) + .format(content)) else: tab_sep_string = "\t".join(content.values()) if not self._is_excluded(tab_sep_string): From 5668a5dfb459b05ce326fb0b6987640618716892 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 13:20:49 +0200 Subject: [PATCH 03/23] Fix column number --- src/mlx/warnings/polyspace_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index 0312fa3e..2be4aafd 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -243,7 +243,7 @@ def add_code_quality_finding(self, row): if "line" in row: finding["location"]["positions"]["begin"]["line"] = row["line"] if "col" in row: - finding["location"]["positions"]["begin"]["column"] = row["line"] + finding["location"]["positions"]["begin"]["column"] = row["column"] finding["description"] = description exclude = ("new", "status", "severity", "comment", "key") row_without_key = [value for key, value in row.items() if key not in exclude] From e2482585b6bf82671be2e63ca88f8ef040bfae0b Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 13:23:23 +0200 Subject: [PATCH 04/23] Fix typo; col is used instead of column --- src/mlx/warnings/polyspace_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index 2be4aafd..e0326e73 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -243,7 +243,7 @@ def add_code_quality_finding(self, row): if "line" in row: finding["location"]["positions"]["begin"]["line"] = row["line"] if "col" in row: - finding["location"]["positions"]["begin"]["column"] = row["column"] + finding["location"]["positions"]["begin"]["column"] = row["col"] finding["description"] = description exclude = ("new", "status", "severity", "comment", "key") row_without_key = [value for key, value in row.items() if key not in exclude] From 10b1b1667bf7f7971f5018219312e1b0d2fe8f22 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 13:25:26 +0200 Subject: [PATCH 05/23] Change some status to "Justified" or "Not a defect"; 5 less defects in tests --- tests/test_in/polyspace.tsv | 12 ++-- tests/test_in/polyspace_code_quality.json | 70 ------------------- .../polyspace_code_quality_exclude.json | 28 -------- tests/test_polyspace.py | 8 +-- 4 files changed, 10 insertions(+), 108 deletions(-) diff --git a/tests/test_in/polyspace.tsv b/tests/test_in/polyspace.tsv index a7c04cbf..b90473b0 100644 --- a/tests/test_in/polyspace.tsv +++ b/tests/test_in/polyspace.tsv @@ -25,20 +25,20 @@ ID Family Group Color New Check Information Function File Status Severity Commen 22036 Run-time Check Numerical Green no Overflow dummy_function() dummy_file_name.c Unreviewed Unset C4992326D32B4698C491 6 4 22065 Run-time Check Data flow Green no Non-initialized local variable dummy_function() dummy_file_name.c Unreviewed Unset C49953E693A45698C489 5 5 22035 Run-time Check Data flow Green no Non-initialized local variable dummy_function() dummy_file_name.c Unreviewed Unset C499232693A45698C491 5 6 -21989 Run-time Check Numerical Green no Overflow dummy_function() dummy_file_name.c Unreviewed Unset C4997327D32B4698C881 6 7 +21989 Run-time Check Numerical Green no Overflow dummy_function() dummy_file_name.c Not a defect Unset C4997327D32B4698C881 6 7 19928 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 62C8B1F4CA9126336A 6 8 -19962 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 62D8A9F4CA91263472 7 9 +19962 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Not a defect Unset 62D8A9F4CA91263472 7 9 19526 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C899F4CA9126316A 7 10 19424 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.h Unreviewed Unset 62E489F4CA91263262 6 11 -19429 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.h Unreviewed Unset 62E4A1F4CA91263162 6 2 +19429 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.h Justified Unset 62E4A1F4CA91263162 6 2 19442 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.h Unreviewed Unset 62C091F4CA91263170 7 3 -19450 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.h Unreviewed Unset 62C091F4CA91263170 7 3 +19450 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.h Justified Unset 62C091F4CA91263170 7 3 19375 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C089F4CA9126326C 8 4 19378 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C091F4CA9126316E 8 5 19377 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C091F4CA9126336A 7 6 19357 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C8A9F4CA91263368 7 7 19352 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C8A9F4CA91263760 8 8 -19351 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C8A9F4CA91263862 8 9 +19351 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Justified Unset 66C8A9F4CA91263862 8 9 19355 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C8A9F4CA91263962 9 10 19354 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset CC9153E995234C62C091 9 11 19358 Run-time Check Numerical Orange no Overflow Origin: Path related issue dummy_function() dummy_file_name.c Unreviewed Unset CC9153E995234C62C0C1 8 3 @@ -46,7 +46,7 @@ ID Family Group Color New Check Information Function File Status Severity Commen 19349 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C8C1F4CA91263262 9 5 19345 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C8C1F4CA91263470 9 6 19344 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66C8C1F4CA91263572 10 7 -19339 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66CC91F4CA91263464 10 8 +19339 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Not a defect Unset 66CC91F4CA91263464 10 8 19338 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66CC91F4CA91263468 9 9 19336 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset 66CC91F4CA91263970 9 10 19335 Run-time Check Numerical Orange no Overflow dummy_function() dummy_file_name.c Unreviewed Unset CC9923E995234C62C0C9 10 11 diff --git a/tests/test_in/polyspace_code_quality.json b/tests/test_in/polyspace_code_quality.json index a3635430..26aa8ec3 100644 --- a/tests/test_in/polyspace_code_quality.json +++ b/tests/test_in/polyspace_code_quality.json @@ -13,20 +13,6 @@ "description": "Polyspace: Overflow", "fingerprint": "07bf7b7981eea1d6f5a95d69c9b0d05d" }, - { - "severity": "major", - "location": { - "path": "dummy_file_name.c", - "positions": { - "begin": { - "line": "7", - "column": "7" - } - } - }, - "description": "Polyspace: Overflow", - "fingerprint": "29a5e4588709eb7271a30605d4fd3bd3" - }, { "severity": "major", "location": { @@ -55,20 +41,6 @@ "description": "Polyspace: Overflow", "fingerprint": "839e418eda6b091c2413aa0722796fb9" }, - { - "severity": "major", - "location": { - "path": "dummy_file_name.h", - "positions": { - "begin": { - "line": "6", - "column": "6" - } - } - }, - "description": "Polyspace: Overflow", - "fingerprint": "cabd96c885bd6d9ed3fe867b227e8128" - }, { "severity": "major", "location": { @@ -83,20 +55,6 @@ "description": "Polyspace: Overflow", "fingerprint": "1961351c7f028d02202f915a6d36c658" }, - { - "severity": "major", - "location": { - "path": "dummy_file_name.h", - "positions": { - "begin": { - "line": "7", - "column": "7" - } - } - }, - "description": "Polyspace: Overflow", - "fingerprint": "fb6455c4794157cb304be4106e115e35" - }, { "severity": "major", "location": { @@ -167,20 +125,6 @@ "description": "Polyspace: Overflow", "fingerprint": "e790d2d7f4e8fc2fb244ab0f74beca64" }, - { - "severity": "major", - "location": { - "path": "dummy_file_name.c", - "positions": { - "begin": { - "line": "8", - "column": "8" - } - } - }, - "description": "Polyspace: Overflow", - "fingerprint": "2848e52a5925a6e7d35aacf6cbf5afed" - }, { "severity": "major", "location": { @@ -279,20 +223,6 @@ "description": "Polyspace: Overflow", "fingerprint": "591d152475bd60b07e0e7f00ec000229" }, - { - "severity": "major", - "location": { - "path": "dummy_file_name.c", - "positions": { - "begin": { - "line": "10", - "column": "10" - } - } - }, - "description": "Polyspace: Overflow", - "fingerprint": "c1886be8c04e07b85f86f2571f0fa03d" - }, { "severity": "major", "location": { diff --git a/tests/test_in/polyspace_code_quality_exclude.json b/tests/test_in/polyspace_code_quality_exclude.json index 401a7e49..cd45d960 100644 --- a/tests/test_in/polyspace_code_quality_exclude.json +++ b/tests/test_in/polyspace_code_quality_exclude.json @@ -13,20 +13,6 @@ "description": "12345 Run-time Check: Overflow", "fingerprint": "839e418eda6b091c2413aa0722796fb9" }, - { - "severity": "major", - "location": { - "path": "dummy_file_name.h", - "positions": { - "begin": { - "line": "6", - "column": "6" - } - } - }, - "description": "12345 Run-time Check: Overflow", - "fingerprint": "cabd96c885bd6d9ed3fe867b227e8128" - }, { "severity": "major", "location": { @@ -41,20 +27,6 @@ "description": "12345 Run-time Check: Overflow", "fingerprint": "1961351c7f028d02202f915a6d36c658" }, - { - "severity": "major", - "location": { - "path": "dummy_file_name.h", - "positions": { - "begin": { - "line": "7", - "column": "7" - } - } - }, - "description": "12345 Run-time Check: Overflow", - "fingerprint": "fb6455c4794157cb304be4106e115e35" - }, { "severity": "critical", "location": { diff --git a/tests/test_polyspace.py b/tests/test_polyspace.py index 793e3566..6f19d4ed 100644 --- a/tests/test_polyspace.py +++ b/tests/test_polyspace.py @@ -36,7 +36,7 @@ def test_code_prover_tsv_file(self): stdout_log ) self.assertEqual(count, count_sum) - self.assertEqual(count, 24) + self.assertEqual(count, 19) class TestBugFinderWarnings(unittest.TestCase): @@ -79,7 +79,7 @@ def test_config_file(self): '--config', str(TEST_IN_DIR / 'config_example_polyspace.yml'), str(TEST_IN_DIR / 'polyspace.tsv') ]) - self.assertEqual(66, retval) + self.assertEqual(61, retval) def test_code_quality(self): filename = 'polyspace_code_quality.json' @@ -90,7 +90,7 @@ def test_code_quality(self): '--config', str(TEST_IN_DIR / 'config_example_polyspace.yml'), str(TEST_IN_DIR / 'polyspace.tsv'), ]) - self.assertEqual(66, retval) + self.assertEqual(61, retval) self.assertTrue(filecmp.cmp(out_file, ref_file)) def test_code_quality_no_green(self): @@ -101,7 +101,7 @@ def test_code_quality_no_green(self): '--config', str(TEST_IN_DIR / 'config_example_polyspace_green.yml'), str(TEST_IN_DIR / 'polyspace.tsv'), ]) - self.assertEqual(66, retval) + self.assertEqual(61, retval) self.assertTrue(filecmp.cmp(out_file, ref_file)) def test_exclude_yaml_config(self): From f03cfb10ce2bb25dbb1e2c60e6f8d550c1915295 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 13:27:07 +0200 Subject: [PATCH 06/23] Change test code quality to use the right column numbers --- tests/test_in/polyspace_code_quality.json | 142 +++++++++--------- .../polyspace_code_quality_exclude.json | 88 +++++------ 2 files changed, 115 insertions(+), 115 deletions(-) diff --git a/tests/test_in/polyspace_code_quality.json b/tests/test_in/polyspace_code_quality.json index 26aa8ec3..652d9ee0 100644 --- a/tests/test_in/polyspace_code_quality.json +++ b/tests/test_in/polyspace_code_quality.json @@ -6,7 +6,7 @@ "positions": { "begin": { "line": "6", - "column": "6" + "column": "8" } } }, @@ -20,7 +20,7 @@ "positions": { "begin": { "line": "7", - "column": "7" + "column": "10" } } }, @@ -34,7 +34,7 @@ "positions": { "begin": { "line": "6", - "column": "6" + "column": "11" } } }, @@ -48,7 +48,7 @@ "positions": { "begin": { "line": "7", - "column": "7" + "column": "3" } } }, @@ -62,7 +62,7 @@ "positions": { "begin": { "line": "8", - "column": "8" + "column": "4" } } }, @@ -76,7 +76,7 @@ "positions": { "begin": { "line": "8", - "column": "8" + "column": "5" } } }, @@ -90,7 +90,7 @@ "positions": { "begin": { "line": "7", - "column": "7" + "column": "6" } } }, @@ -132,7 +132,7 @@ "positions": { "begin": { "line": "9", - "column": "9" + "column": "10" } } }, @@ -146,7 +146,7 @@ "positions": { "begin": { "line": "9", - "column": "9" + "column": "11" } } }, @@ -160,7 +160,7 @@ "positions": { "begin": { "line": "8", - "column": "8" + "column": "3" } } }, @@ -174,7 +174,7 @@ "positions": { "begin": { "line": "8", - "column": "8" + "column": "4" } } }, @@ -188,7 +188,7 @@ "positions": { "begin": { "line": "9", - "column": "9" + "column": "5" } } }, @@ -202,7 +202,7 @@ "positions": { "begin": { "line": "9", - "column": "9" + "column": "6" } } }, @@ -216,7 +216,7 @@ "positions": { "begin": { "line": "10", - "column": "10" + "column": "7" } } }, @@ -244,7 +244,7 @@ "positions": { "begin": { "line": "9", - "column": "9" + "column": "10" } } }, @@ -258,7 +258,7 @@ "positions": { "begin": { "line": "10", - "column": "10" + "column": "11" } } }, @@ -272,7 +272,7 @@ "positions": { "begin": { "line": "15", - "column": "15" + "column": "5" } } }, @@ -286,7 +286,7 @@ "positions": { "begin": { "line": "15", - "column": "15" + "column": "6" } } }, @@ -300,7 +300,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "7" } } }, @@ -314,7 +314,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "8" } } }, @@ -328,7 +328,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "9" } } }, @@ -342,7 +342,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "10" } } }, @@ -356,7 +356,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "11" } } }, @@ -370,7 +370,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "12" } } }, @@ -384,7 +384,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "13" } } }, @@ -398,7 +398,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "14" } } }, @@ -412,7 +412,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "5" } } }, @@ -426,7 +426,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "6" } } }, @@ -440,7 +440,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "6" } } }, @@ -454,7 +454,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "7" } } }, @@ -468,7 +468,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "8" } } }, @@ -482,7 +482,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "9" } } }, @@ -496,7 +496,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "10" } } }, @@ -510,7 +510,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "11" } } }, @@ -524,7 +524,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "12" } } }, @@ -538,7 +538,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "13" } } }, @@ -552,7 +552,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "14" } } }, @@ -566,7 +566,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "6" } } }, @@ -580,7 +580,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "7" } } }, @@ -594,7 +594,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "8" } } }, @@ -608,7 +608,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "9" } } }, @@ -622,7 +622,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "10" } } }, @@ -636,7 +636,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "11" } } }, @@ -650,7 +650,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "12" } } }, @@ -664,7 +664,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "13" } } }, @@ -678,7 +678,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "14" } } }, @@ -692,7 +692,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "15" } } }, @@ -706,7 +706,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "6" } } }, @@ -720,7 +720,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "7" } } }, @@ -734,7 +734,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "7" } } }, @@ -748,7 +748,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "8" } } }, @@ -762,7 +762,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "9" } } }, @@ -776,7 +776,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "10" } } }, @@ -790,7 +790,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "11" } } }, @@ -804,7 +804,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "12" } } }, @@ -818,7 +818,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "13" } } }, @@ -832,7 +832,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "14" } } }, @@ -846,7 +846,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "15" } } }, @@ -860,7 +860,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "7" } } }, @@ -874,7 +874,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "8" } } }, @@ -888,7 +888,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "9" } } }, @@ -902,7 +902,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "10" } } }, @@ -916,7 +916,7 @@ "positions": { "begin": { "line": "24", - "column": "24" + "column": "11" } } }, @@ -930,7 +930,7 @@ "positions": { "begin": { "line": "24", - "column": "24" + "column": "12" } } }, @@ -944,7 +944,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "13" } } }, @@ -958,7 +958,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "14" } } }, @@ -972,7 +972,7 @@ "positions": { "begin": { "line": "24", - "column": "24" + "column": "15" } } }, @@ -986,7 +986,7 @@ "positions": { "begin": { "line": "24", - "column": "24" + "column": "16" } } }, @@ -1000,7 +1000,7 @@ "positions": { "begin": { "line": "25", - "column": "25" + "column": "7" } } }, @@ -1014,7 +1014,7 @@ "positions": { "begin": { "line": "25", - "column": "25" + "column": "8" } } }, @@ -1028,7 +1028,7 @@ "positions": { "begin": { "line": "24", - "column": "24" + "column": "8" } } }, diff --git a/tests/test_in/polyspace_code_quality_exclude.json b/tests/test_in/polyspace_code_quality_exclude.json index cd45d960..36b76a21 100644 --- a/tests/test_in/polyspace_code_quality_exclude.json +++ b/tests/test_in/polyspace_code_quality_exclude.json @@ -6,7 +6,7 @@ "positions": { "begin": { "line": "6", - "column": "6" + "column": "11" } } }, @@ -20,7 +20,7 @@ "positions": { "begin": { "line": "7", - "column": "7" + "column": "3" } } }, @@ -34,7 +34,7 @@ "positions": { "begin": { "line": "15", - "column": "15" + "column": "5" } } }, @@ -48,7 +48,7 @@ "positions": { "begin": { "line": "15", - "column": "15" + "column": "6" } } }, @@ -62,7 +62,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "7" } } }, @@ -76,7 +76,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "8" } } }, @@ -90,7 +90,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "9" } } }, @@ -104,7 +104,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "10" } } }, @@ -118,7 +118,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "11" } } }, @@ -132,7 +132,7 @@ "positions": { "begin": { "line": "16", - "column": "16" + "column": "12" } } }, @@ -146,7 +146,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "13" } } }, @@ -160,7 +160,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "14" } } }, @@ -174,7 +174,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "5" } } }, @@ -188,7 +188,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "6" } } }, @@ -202,7 +202,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "6" } } }, @@ -216,7 +216,7 @@ "positions": { "begin": { "line": "17", - "column": "17" + "column": "7" } } }, @@ -230,7 +230,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "8" } } }, @@ -244,7 +244,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "9" } } }, @@ -258,7 +258,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "10" } } }, @@ -272,7 +272,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "11" } } }, @@ -286,7 +286,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "12" } } }, @@ -300,7 +300,7 @@ "positions": { "begin": { "line": "18", - "column": "18" + "column": "13" } } }, @@ -314,7 +314,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "14" } } }, @@ -328,7 +328,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "6" } } }, @@ -342,7 +342,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "7" } } }, @@ -356,7 +356,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "8" } } }, @@ -370,7 +370,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "9" } } }, @@ -384,7 +384,7 @@ "positions": { "begin": { "line": "19", - "column": "19" + "column": "10" } } }, @@ -398,7 +398,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "11" } } }, @@ -412,7 +412,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "12" } } }, @@ -426,7 +426,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "13" } } }, @@ -440,7 +440,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "14" } } }, @@ -454,7 +454,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "15" } } }, @@ -468,7 +468,7 @@ "positions": { "begin": { "line": "20", - "column": "20" + "column": "6" } } }, @@ -482,7 +482,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "7" } } }, @@ -496,7 +496,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "7" } } }, @@ -510,7 +510,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "8" } } }, @@ -524,7 +524,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "9" } } }, @@ -538,7 +538,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "10" } } }, @@ -552,7 +552,7 @@ "positions": { "begin": { "line": "21", - "column": "21" + "column": "11" } } }, @@ -566,7 +566,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "12" } } }, @@ -580,7 +580,7 @@ "positions": { "begin": { "line": "22", - "column": "22" + "column": "13" } } }, @@ -594,7 +594,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "14" } } }, @@ -608,7 +608,7 @@ "positions": { "begin": { "line": "23", - "column": "23" + "column": "15" } } }, From ada326c5dcfdedaca60d4ef9e787aac4376e4ce1 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 13:48:51 +0200 Subject: [PATCH 07/23] Add explanation about the excluded statuses in readme --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index 77dd723f..78e2c30a 100644 --- a/README.rst +++ b/README.rst @@ -324,6 +324,15 @@ For example, "run-time check" is the family of Code Prover and "defect" is the f The value of that key is a list, which contains the name of the column to check as a key and the value of that column to check together with ``min`` and ``max`` values. +Note that all defects with one of the following statuses are excluded from the warnings and code quality report: +- Justified +- No Action Planned +- Not a Defect +These statuses are used when you do not plan to fix your code in response to a result. +More info can be found `on this help page`_. + +.. _`on this help page`: https://nl.mathworks.com/help/polyspace_access/ug/fix-or-comment-polyspace-results-web-browser.html + Example Checks ^^^^^^^^^^^^^^ From c13c003549d9fe02ce80b1cddb677c0ba7a0d179 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 13:54:17 +0200 Subject: [PATCH 08/23] Delete default status "No Action Planned" from the excluded statuses --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 78e2c30a..677a3687 100644 --- a/README.rst +++ b/README.rst @@ -326,9 +326,10 @@ the value of that column to check together with ``min`` and ``max`` values. Note that all defects with one of the following statuses are excluded from the warnings and code quality report: - Justified -- No Action Planned - Not a Defect These statuses are used when you do not plan to fix your code in response to a result. +The status "No Action Planned" is not listed because this is a default status if you do not explicitly specfify +a status in you annotation. More info can be found `on this help page`_. .. _`on this help page`: https://nl.mathworks.com/help/polyspace_access/ug/fix-or-comment-polyspace-results-web-browser.html From 0b4eb2a649dc84a2dd2b6dd2b6b61f2482ce8b48 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 14:48:13 +0200 Subject: [PATCH 09/23] Make substitution of environment variables possible for min and max of different checker of Polyspace and Robot --- src/mlx/warnings/polyspace_checker.py | 15 +++++++++++++++ src/mlx/warnings/robot_checker.py | 15 +++++++++++++++ .../config_example_polyspace_exclude.json | 4 ++-- tests/test_in/config_example_robot.json | 4 ++-- tests/test_integration.py | 19 +++++++++++++++++++ tests/test_polyspace.py | 6 +++--- 6 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index e0326e73..46bec72a 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -113,6 +113,20 @@ def return_check_limits(self): count += checker.return_check_limits() return count + def config_parser(self, config, name): + ''' Parsing configuration dict extracted by previously opened JSON or YAML file + + Args: + config (dict): Content of configuration file + ''' + try: + from .warnings import substitute_envvar + + substitute_envvar(config, {'min', 'max'}) + print("Config parsing for {name} completed".format(name=name)) + except KeyError as err: + print("Incomplete config. Missing: {key}".format(key=err)) + def parse_config(self, config): """Parsing configuration dict extracted by previously opened JSON or yaml/yml file @@ -145,6 +159,7 @@ def parse_config(self, config): column_name = key.lower() check_value = value.lower() checker = PolyspaceFamilyChecker(family_value, column_name, check_value, verbose=self.verbose) + self.config_parser(check, f"{family_value} ({column_name}:{check_value})") checker.parse_config(check) checker.cq_findings = self.cq_findings # share object with sub-checkers self.checkers.append(checker) diff --git a/src/mlx/warnings/robot_checker.py b/src/mlx/warnings/robot_checker.py index 5a1e7c04..c06ad0ad 100644 --- a/src/mlx/warnings/robot_checker.py +++ b/src/mlx/warnings/robot_checker.py @@ -88,12 +88,27 @@ def return_check_limits(self): count += checker.return_check_limits() return count + def config_parser(self, config, name): + ''' Parsing configuration dict extracted by previously opened JSON or YAML file + + Args: + config (dict): Content of configuration file + ''' + try: + from .warnings import substitute_envvar + + substitute_envvar(config, {'min', 'max'}) + print("Config parsing for suite {name!r} completed".format(name=name)) + except KeyError as err: + print("Incomplete config. Missing: {key}".format(key=err)) + def parse_config(self, config): self.checkers = [] check_suite_name = config.get('check_suite_names', True) for suite_config in config['suites']: checker = RobotSuiteChecker(suite_config['name'], check_suite_name=check_suite_name, verbose=self.verbose) + self.config_parser(suite_config, suite_config['name']) checker.parse_config(suite_config) self.checkers.append(checker) diff --git a/tests/test_in/config_example_polyspace_exclude.json b/tests/test_in/config_example_polyspace_exclude.json index 2707d066..27ac3fae 100644 --- a/tests/test_in/config_example_polyspace_exclude.json +++ b/tests/test_in/config_example_polyspace_exclude.json @@ -36,8 +36,8 @@ "run-time check": [ { "color": "red", - "min": 0, - "max": 0 + "min": "$MIN_POLY_WARNINGS", + "max": "${MAX_POLY_WARNINGS}" }, { "color": "orange", diff --git a/tests/test_in/config_example_robot.json b/tests/test_in/config_example_robot.json index 86f74c5a..1bc6ef96 100644 --- a/tests/test_in/config_example_robot.json +++ b/tests/test_in/config_example_robot.json @@ -45,8 +45,8 @@ }, { "name": "b4d su1te name", - "min": 0, - "max": 0 + "min": "$MIN_ROBOT_WARNINGS", + "max": "${MAX_ROBOT_WARNINGS}" } ] }, diff --git a/tests/test_integration.py b/tests/test_integration.py index 02341238..00cca9d6 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -189,6 +189,7 @@ def test_robot_verbose(self): self.assertEqual(1, retval) self.assertEqual( '\n'.join([ + "Config parsing for suite 'Suite Two' completed", "Suite One & Suite Two.Suite Two.Another test", "Suite 'Suite Two': 1 warnings found", "Counted failures for test suite 'Suite Two'.", @@ -198,6 +199,8 @@ def test_robot_verbose(self): ) def test_robot_config(self): + os.environ['MIN_ROBOT_WARNINGS'] = '0' + os.environ['MAX_ROBOT_WARNINGS'] = '0' with patch('sys.stdout', new=StringIO()) as fake_out: retval = warnings_wrapper([ '--config', @@ -208,6 +211,10 @@ def test_robot_config(self): self.assertEqual( '\n'.join([ + "Config parsing for suite 'Suite One' completed", + "Config parsing for suite '' completed", + "Config parsing for suite 'Suite Two' completed", + "Config parsing for suite 'b4d su1te name' completed", "Config parsing for robot completed", "Suite 'Suite One': 1 warnings found", "2 warnings found", @@ -225,6 +232,9 @@ def test_robot_config(self): stdout_log ) self.assertEqual(2, retval) + for var in ('MIN_ROBOT_WARNINGS', 'MAX_ROBOT_WARNINGS'): + if var in os.environ: + del os.environ[var] def test_robot_config_check_names(self): self.maxDiff = None @@ -236,6 +246,9 @@ def test_robot_config_check_names(self): self.assertEqual( '\n'.join([ + "Config parsing for suite 'b4d su1te name' completed", + "Config parsing for suite '' completed", + "Config parsing for suite 'Suite Two' completed", "Config parsing for robot completed", "ERROR: No suite with name 'b4d su1te name' found. Returning error code -1.", ]) + '\n', @@ -253,6 +266,7 @@ def test_robot_cli_check_name(self): self.assertEqual( '\n'.join([ + "Config parsing for suite 'Inv4lid Name' completed", "ERROR: No suite with name 'Inv4lid Name' found. Returning error code -1.", ]) + '\n', stdout_log @@ -281,6 +295,8 @@ def test_output_file_robot_basic(self): self.assertTrue(filecmp.cmp(out_file, ref_file), '{} differs from {}'.format(out_file, ref_file)) def test_output_file_robot_config(self): + os.environ['MIN_ROBOT_WARNINGS'] = '0' + os.environ['MAX_ROBOT_WARNINGS'] = '0' filename = 'robot_double_fail_config_summary.txt' out_file = str(TEST_OUT_DIR / filename) ref_file = str(TEST_IN_DIR / filename) @@ -291,6 +307,9 @@ def test_output_file_robot_config(self): ]) self.assertEqual(2, retval) self.assertTrue(filecmp.cmp(out_file, ref_file), '{} differs from {}'.format(out_file, ref_file)) + for var in ('MIN_ROBOT_WARNINGS', 'MAX_ROBOT_WARNINGS'): + if var in os.environ: + del os.environ[var] def test_output_file_junit(self): filename = 'junit_double_fail_summary.txt' diff --git a/tests/test_polyspace.py b/tests/test_polyspace.py index 6f19d4ed..090a0c2b 100644 --- a/tests/test_polyspace.py +++ b/tests/test_polyspace.py @@ -66,11 +66,11 @@ def test_bug_finder_tsv_file(self): class TestPolyspaceWarnings(unittest.TestCase): def setUp(self): - os.environ['MIN_SPHINX_WARNINGS'] = '0' - os.environ['MAX_SPHINX_WARNINGS'] = '0' + os.environ['MIN_POLY_WARNINGS'] = '0' + os.environ['MAX_POLY_WARNINGS'] = '0' def tearDown(self): - for var in ('MIN_SPHINX_WARNINGS', 'MAX_SPHINX_WARNINGS'): + for var in ('MIN_POLY_WARNINGS', 'MAX_POLY_WARNINGS'): if var in os.environ: del os.environ[var] From deecdd1e39080eb05d5496c6c88fa6b8d55bc659 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 14:55:48 +0200 Subject: [PATCH 10/23] Fix over-indented --- src/mlx/warnings/polyspace_checker.py | 2 +- src/mlx/warnings/robot_checker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index 46bec72a..6996f9c3 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -125,7 +125,7 @@ def config_parser(self, config, name): substitute_envvar(config, {'min', 'max'}) print("Config parsing for {name} completed".format(name=name)) except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) + print("Incomplete config. Missing: {key}".format(key=err)) def parse_config(self, config): """Parsing configuration dict extracted by previously opened JSON or yaml/yml file diff --git a/src/mlx/warnings/robot_checker.py b/src/mlx/warnings/robot_checker.py index c06ad0ad..3cc54143 100644 --- a/src/mlx/warnings/robot_checker.py +++ b/src/mlx/warnings/robot_checker.py @@ -100,7 +100,7 @@ def config_parser(self, config, name): substitute_envvar(config, {'min', 'max'}) print("Config parsing for suite {name!r} completed".format(name=name)) except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) + print("Incomplete config. Missing: {key}".format(key=err)) def parse_config(self, config): self.checkers = [] From dc0ca29e22c858f237edc838ab612f17c0fb8b3f Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 15:21:02 +0200 Subject: [PATCH 11/23] Fix bullet list --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 677a3687..1c220664 100644 --- a/README.rst +++ b/README.rst @@ -325,8 +325,10 @@ The value of that key is a list, which contains the name of the column to check the value of that column to check together with ``min`` and ``max`` values. Note that all defects with one of the following statuses are excluded from the warnings and code quality report: + - Justified - Not a Defect + These statuses are used when you do not plan to fix your code in response to a result. The status "No Action Planned" is not listed because this is a default status if you do not explicitly specfify a status in you annotation. From 7b57dc73397eff9e32acfbf36744a1d4ff3b47b8 Mon Sep 17 00:00:00 2001 From: PietVR <52536820+pietvr@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:59:27 +0200 Subject: [PATCH 12/23] Update README.rst typo correction --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1c220664..b2637140 100644 --- a/README.rst +++ b/README.rst @@ -330,7 +330,7 @@ Note that all defects with one of the following statuses are excluded from the w - Not a Defect These statuses are used when you do not plan to fix your code in response to a result. -The status "No Action Planned" is not listed because this is a default status if you do not explicitly specfify +The status "No Action Planned" is not listed because this is a default status if you do not explicitly specify a status in you annotation. More info can be found `on this help page`_. From b86dbb6941bbb3ab352f32aa48c8e8dfa32c3618 Mon Sep 17 00:00:00 2001 From: JWM <62558419+JokeWaumans@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:06:53 +0200 Subject: [PATCH 13/23] Rephrase Co-authored-by: Jasper Craeghs <28319872+JasperCraeghs@users.noreply.github.com> --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index b2637140..b8e4c9fa 100644 --- a/README.rst +++ b/README.rst @@ -324,7 +324,7 @@ For example, "run-time check" is the family of Code Prover and "defect" is the f The value of that key is a list, which contains the name of the column to check as a key and the value of that column to check together with ``min`` and ``max`` values. -Note that all defects with one of the following statuses are excluded from the warnings and code quality report: +All results with one of the following statuses are discarded altogether: - Justified - Not a Defect From bd2ee461794769e1d5e152f5f5e59bef7a5bc527 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 16:11:40 +0200 Subject: [PATCH 14/23] Rephrase README --- README.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index b8e4c9fa..49286506 100644 --- a/README.rst +++ b/README.rst @@ -329,12 +329,11 @@ All results with one of the following statuses are discarded altogether: - Justified - Not a Defect -These statuses are used when you do not plan to fix your code in response to a result. -The status "No Action Planned" is not listed because this is a default status if you do not explicitly specify -a status in you annotation. -More info can be found `on this help page`_. +These statuses indicate that you have given due consideration and justified that result, as described +in `Polyspace's documentation about results`_. +The status "No Action Planned" is not treated differently because this is the default status for annotations. -.. _`on this help page`: https://nl.mathworks.com/help/polyspace_access/ug/fix-or-comment-polyspace-results-web-browser.html +.. _`Polyspace's documentation about results`: https://nl.mathworks.com/help/polyspace_access/ug/fix-or-comment-polyspace-results-web-browser.html Example Checks ^^^^^^^^^^^^^^ From 6e8cb8d0abbb036b954f3e13cab9c2637a0446b4 Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:27:26 +0200 Subject: [PATCH 15/23] Revert "Fix over-indented" This reverts commit deecdd1e39080eb05d5496c6c88fa6b8d55bc659. --- src/mlx/warnings/polyspace_checker.py | 2 +- src/mlx/warnings/robot_checker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index 6996f9c3..46bec72a 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -125,7 +125,7 @@ def config_parser(self, config, name): substitute_envvar(config, {'min', 'max'}) print("Config parsing for {name} completed".format(name=name)) except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) + print("Incomplete config. Missing: {key}".format(key=err)) def parse_config(self, config): """Parsing configuration dict extracted by previously opened JSON or yaml/yml file diff --git a/src/mlx/warnings/robot_checker.py b/src/mlx/warnings/robot_checker.py index 3cc54143..c06ad0ad 100644 --- a/src/mlx/warnings/robot_checker.py +++ b/src/mlx/warnings/robot_checker.py @@ -100,7 +100,7 @@ def config_parser(self, config, name): substitute_envvar(config, {'min', 'max'}) print("Config parsing for suite {name!r} completed".format(name=name)) except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) + print("Incomplete config. Missing: {key}".format(key=err)) def parse_config(self, config): self.checkers = [] From ff64d7464e31785b5b370e43d1603e6fcb8d75df Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:27:40 +0200 Subject: [PATCH 16/23] Revert "Make substitution of environment variables possible for min and max of different checker of Polyspace and Robot" This reverts commit 0b4eb2a649dc84a2dd2b6dd2b6b61f2482ce8b48. --- src/mlx/warnings/polyspace_checker.py | 15 --------------- src/mlx/warnings/robot_checker.py | 15 --------------- .../config_example_polyspace_exclude.json | 4 ++-- tests/test_in/config_example_robot.json | 4 ++-- tests/test_integration.py | 19 ------------------- tests/test_polyspace.py | 6 +++--- 6 files changed, 7 insertions(+), 56 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index 46bec72a..e0326e73 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -113,20 +113,6 @@ def return_check_limits(self): count += checker.return_check_limits() return count - def config_parser(self, config, name): - ''' Parsing configuration dict extracted by previously opened JSON or YAML file - - Args: - config (dict): Content of configuration file - ''' - try: - from .warnings import substitute_envvar - - substitute_envvar(config, {'min', 'max'}) - print("Config parsing for {name} completed".format(name=name)) - except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) - def parse_config(self, config): """Parsing configuration dict extracted by previously opened JSON or yaml/yml file @@ -159,7 +145,6 @@ def parse_config(self, config): column_name = key.lower() check_value = value.lower() checker = PolyspaceFamilyChecker(family_value, column_name, check_value, verbose=self.verbose) - self.config_parser(check, f"{family_value} ({column_name}:{check_value})") checker.parse_config(check) checker.cq_findings = self.cq_findings # share object with sub-checkers self.checkers.append(checker) diff --git a/src/mlx/warnings/robot_checker.py b/src/mlx/warnings/robot_checker.py index c06ad0ad..5a1e7c04 100644 --- a/src/mlx/warnings/robot_checker.py +++ b/src/mlx/warnings/robot_checker.py @@ -88,27 +88,12 @@ def return_check_limits(self): count += checker.return_check_limits() return count - def config_parser(self, config, name): - ''' Parsing configuration dict extracted by previously opened JSON or YAML file - - Args: - config (dict): Content of configuration file - ''' - try: - from .warnings import substitute_envvar - - substitute_envvar(config, {'min', 'max'}) - print("Config parsing for suite {name!r} completed".format(name=name)) - except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) - def parse_config(self, config): self.checkers = [] check_suite_name = config.get('check_suite_names', True) for suite_config in config['suites']: checker = RobotSuiteChecker(suite_config['name'], check_suite_name=check_suite_name, verbose=self.verbose) - self.config_parser(suite_config, suite_config['name']) checker.parse_config(suite_config) self.checkers.append(checker) diff --git a/tests/test_in/config_example_polyspace_exclude.json b/tests/test_in/config_example_polyspace_exclude.json index 27ac3fae..2707d066 100644 --- a/tests/test_in/config_example_polyspace_exclude.json +++ b/tests/test_in/config_example_polyspace_exclude.json @@ -36,8 +36,8 @@ "run-time check": [ { "color": "red", - "min": "$MIN_POLY_WARNINGS", - "max": "${MAX_POLY_WARNINGS}" + "min": 0, + "max": 0 }, { "color": "orange", diff --git a/tests/test_in/config_example_robot.json b/tests/test_in/config_example_robot.json index 1bc6ef96..86f74c5a 100644 --- a/tests/test_in/config_example_robot.json +++ b/tests/test_in/config_example_robot.json @@ -45,8 +45,8 @@ }, { "name": "b4d su1te name", - "min": "$MIN_ROBOT_WARNINGS", - "max": "${MAX_ROBOT_WARNINGS}" + "min": 0, + "max": 0 } ] }, diff --git a/tests/test_integration.py b/tests/test_integration.py index 00cca9d6..02341238 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -189,7 +189,6 @@ def test_robot_verbose(self): self.assertEqual(1, retval) self.assertEqual( '\n'.join([ - "Config parsing for suite 'Suite Two' completed", "Suite One & Suite Two.Suite Two.Another test", "Suite 'Suite Two': 1 warnings found", "Counted failures for test suite 'Suite Two'.", @@ -199,8 +198,6 @@ def test_robot_verbose(self): ) def test_robot_config(self): - os.environ['MIN_ROBOT_WARNINGS'] = '0' - os.environ['MAX_ROBOT_WARNINGS'] = '0' with patch('sys.stdout', new=StringIO()) as fake_out: retval = warnings_wrapper([ '--config', @@ -211,10 +208,6 @@ def test_robot_config(self): self.assertEqual( '\n'.join([ - "Config parsing for suite 'Suite One' completed", - "Config parsing for suite '' completed", - "Config parsing for suite 'Suite Two' completed", - "Config parsing for suite 'b4d su1te name' completed", "Config parsing for robot completed", "Suite 'Suite One': 1 warnings found", "2 warnings found", @@ -232,9 +225,6 @@ def test_robot_config(self): stdout_log ) self.assertEqual(2, retval) - for var in ('MIN_ROBOT_WARNINGS', 'MAX_ROBOT_WARNINGS'): - if var in os.environ: - del os.environ[var] def test_robot_config_check_names(self): self.maxDiff = None @@ -246,9 +236,6 @@ def test_robot_config_check_names(self): self.assertEqual( '\n'.join([ - "Config parsing for suite 'b4d su1te name' completed", - "Config parsing for suite '' completed", - "Config parsing for suite 'Suite Two' completed", "Config parsing for robot completed", "ERROR: No suite with name 'b4d su1te name' found. Returning error code -1.", ]) + '\n', @@ -266,7 +253,6 @@ def test_robot_cli_check_name(self): self.assertEqual( '\n'.join([ - "Config parsing for suite 'Inv4lid Name' completed", "ERROR: No suite with name 'Inv4lid Name' found. Returning error code -1.", ]) + '\n', stdout_log @@ -295,8 +281,6 @@ def test_output_file_robot_basic(self): self.assertTrue(filecmp.cmp(out_file, ref_file), '{} differs from {}'.format(out_file, ref_file)) def test_output_file_robot_config(self): - os.environ['MIN_ROBOT_WARNINGS'] = '0' - os.environ['MAX_ROBOT_WARNINGS'] = '0' filename = 'robot_double_fail_config_summary.txt' out_file = str(TEST_OUT_DIR / filename) ref_file = str(TEST_IN_DIR / filename) @@ -307,9 +291,6 @@ def test_output_file_robot_config(self): ]) self.assertEqual(2, retval) self.assertTrue(filecmp.cmp(out_file, ref_file), '{} differs from {}'.format(out_file, ref_file)) - for var in ('MIN_ROBOT_WARNINGS', 'MAX_ROBOT_WARNINGS'): - if var in os.environ: - del os.environ[var] def test_output_file_junit(self): filename = 'junit_double_fail_summary.txt' diff --git a/tests/test_polyspace.py b/tests/test_polyspace.py index 090a0c2b..6f19d4ed 100644 --- a/tests/test_polyspace.py +++ b/tests/test_polyspace.py @@ -66,11 +66,11 @@ def test_bug_finder_tsv_file(self): class TestPolyspaceWarnings(unittest.TestCase): def setUp(self): - os.environ['MIN_POLY_WARNINGS'] = '0' - os.environ['MAX_POLY_WARNINGS'] = '0' + os.environ['MIN_SPHINX_WARNINGS'] = '0' + os.environ['MAX_SPHINX_WARNINGS'] = '0' def tearDown(self): - for var in ('MIN_POLY_WARNINGS', 'MAX_POLY_WARNINGS'): + for var in ('MIN_SPHINX_WARNINGS', 'MAX_SPHINX_WARNINGS'): if var in os.environ: del os.environ[var] From 59b1209604e8a5302166cb369573a96a467b516c Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:30:05 +0200 Subject: [PATCH 17/23] Revert "Revert "Make substitution of environment variables possible for min and max of different checker of Polyspace and Robot"" This reverts commit ff64d7464e31785b5b370e43d1603e6fcb8d75df. --- src/mlx/warnings/polyspace_checker.py | 15 +++++++++++++++ src/mlx/warnings/robot_checker.py | 15 +++++++++++++++ .../config_example_polyspace_exclude.json | 4 ++-- tests/test_in/config_example_robot.json | 4 ++-- tests/test_integration.py | 19 +++++++++++++++++++ tests/test_polyspace.py | 6 +++--- 6 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index e0326e73..46bec72a 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -113,6 +113,20 @@ def return_check_limits(self): count += checker.return_check_limits() return count + def config_parser(self, config, name): + ''' Parsing configuration dict extracted by previously opened JSON or YAML file + + Args: + config (dict): Content of configuration file + ''' + try: + from .warnings import substitute_envvar + + substitute_envvar(config, {'min', 'max'}) + print("Config parsing for {name} completed".format(name=name)) + except KeyError as err: + print("Incomplete config. Missing: {key}".format(key=err)) + def parse_config(self, config): """Parsing configuration dict extracted by previously opened JSON or yaml/yml file @@ -145,6 +159,7 @@ def parse_config(self, config): column_name = key.lower() check_value = value.lower() checker = PolyspaceFamilyChecker(family_value, column_name, check_value, verbose=self.verbose) + self.config_parser(check, f"{family_value} ({column_name}:{check_value})") checker.parse_config(check) checker.cq_findings = self.cq_findings # share object with sub-checkers self.checkers.append(checker) diff --git a/src/mlx/warnings/robot_checker.py b/src/mlx/warnings/robot_checker.py index 5a1e7c04..c06ad0ad 100644 --- a/src/mlx/warnings/robot_checker.py +++ b/src/mlx/warnings/robot_checker.py @@ -88,12 +88,27 @@ def return_check_limits(self): count += checker.return_check_limits() return count + def config_parser(self, config, name): + ''' Parsing configuration dict extracted by previously opened JSON or YAML file + + Args: + config (dict): Content of configuration file + ''' + try: + from .warnings import substitute_envvar + + substitute_envvar(config, {'min', 'max'}) + print("Config parsing for suite {name!r} completed".format(name=name)) + except KeyError as err: + print("Incomplete config. Missing: {key}".format(key=err)) + def parse_config(self, config): self.checkers = [] check_suite_name = config.get('check_suite_names', True) for suite_config in config['suites']: checker = RobotSuiteChecker(suite_config['name'], check_suite_name=check_suite_name, verbose=self.verbose) + self.config_parser(suite_config, suite_config['name']) checker.parse_config(suite_config) self.checkers.append(checker) diff --git a/tests/test_in/config_example_polyspace_exclude.json b/tests/test_in/config_example_polyspace_exclude.json index 2707d066..27ac3fae 100644 --- a/tests/test_in/config_example_polyspace_exclude.json +++ b/tests/test_in/config_example_polyspace_exclude.json @@ -36,8 +36,8 @@ "run-time check": [ { "color": "red", - "min": 0, - "max": 0 + "min": "$MIN_POLY_WARNINGS", + "max": "${MAX_POLY_WARNINGS}" }, { "color": "orange", diff --git a/tests/test_in/config_example_robot.json b/tests/test_in/config_example_robot.json index 86f74c5a..1bc6ef96 100644 --- a/tests/test_in/config_example_robot.json +++ b/tests/test_in/config_example_robot.json @@ -45,8 +45,8 @@ }, { "name": "b4d su1te name", - "min": 0, - "max": 0 + "min": "$MIN_ROBOT_WARNINGS", + "max": "${MAX_ROBOT_WARNINGS}" } ] }, diff --git a/tests/test_integration.py b/tests/test_integration.py index 02341238..00cca9d6 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -189,6 +189,7 @@ def test_robot_verbose(self): self.assertEqual(1, retval) self.assertEqual( '\n'.join([ + "Config parsing for suite 'Suite Two' completed", "Suite One & Suite Two.Suite Two.Another test", "Suite 'Suite Two': 1 warnings found", "Counted failures for test suite 'Suite Two'.", @@ -198,6 +199,8 @@ def test_robot_verbose(self): ) def test_robot_config(self): + os.environ['MIN_ROBOT_WARNINGS'] = '0' + os.environ['MAX_ROBOT_WARNINGS'] = '0' with patch('sys.stdout', new=StringIO()) as fake_out: retval = warnings_wrapper([ '--config', @@ -208,6 +211,10 @@ def test_robot_config(self): self.assertEqual( '\n'.join([ + "Config parsing for suite 'Suite One' completed", + "Config parsing for suite '' completed", + "Config parsing for suite 'Suite Two' completed", + "Config parsing for suite 'b4d su1te name' completed", "Config parsing for robot completed", "Suite 'Suite One': 1 warnings found", "2 warnings found", @@ -225,6 +232,9 @@ def test_robot_config(self): stdout_log ) self.assertEqual(2, retval) + for var in ('MIN_ROBOT_WARNINGS', 'MAX_ROBOT_WARNINGS'): + if var in os.environ: + del os.environ[var] def test_robot_config_check_names(self): self.maxDiff = None @@ -236,6 +246,9 @@ def test_robot_config_check_names(self): self.assertEqual( '\n'.join([ + "Config parsing for suite 'b4d su1te name' completed", + "Config parsing for suite '' completed", + "Config parsing for suite 'Suite Two' completed", "Config parsing for robot completed", "ERROR: No suite with name 'b4d su1te name' found. Returning error code -1.", ]) + '\n', @@ -253,6 +266,7 @@ def test_robot_cli_check_name(self): self.assertEqual( '\n'.join([ + "Config parsing for suite 'Inv4lid Name' completed", "ERROR: No suite with name 'Inv4lid Name' found. Returning error code -1.", ]) + '\n', stdout_log @@ -281,6 +295,8 @@ def test_output_file_robot_basic(self): self.assertTrue(filecmp.cmp(out_file, ref_file), '{} differs from {}'.format(out_file, ref_file)) def test_output_file_robot_config(self): + os.environ['MIN_ROBOT_WARNINGS'] = '0' + os.environ['MAX_ROBOT_WARNINGS'] = '0' filename = 'robot_double_fail_config_summary.txt' out_file = str(TEST_OUT_DIR / filename) ref_file = str(TEST_IN_DIR / filename) @@ -291,6 +307,9 @@ def test_output_file_robot_config(self): ]) self.assertEqual(2, retval) self.assertTrue(filecmp.cmp(out_file, ref_file), '{} differs from {}'.format(out_file, ref_file)) + for var in ('MIN_ROBOT_WARNINGS', 'MAX_ROBOT_WARNINGS'): + if var in os.environ: + del os.environ[var] def test_output_file_junit(self): filename = 'junit_double_fail_summary.txt' diff --git a/tests/test_polyspace.py b/tests/test_polyspace.py index 6f19d4ed..090a0c2b 100644 --- a/tests/test_polyspace.py +++ b/tests/test_polyspace.py @@ -66,11 +66,11 @@ def test_bug_finder_tsv_file(self): class TestPolyspaceWarnings(unittest.TestCase): def setUp(self): - os.environ['MIN_SPHINX_WARNINGS'] = '0' - os.environ['MAX_SPHINX_WARNINGS'] = '0' + os.environ['MIN_POLY_WARNINGS'] = '0' + os.environ['MAX_POLY_WARNINGS'] = '0' def tearDown(self): - for var in ('MIN_SPHINX_WARNINGS', 'MAX_SPHINX_WARNINGS'): + for var in ('MIN_POLY_WARNINGS', 'MAX_POLY_WARNINGS'): if var in os.environ: del os.environ[var] From 4923b47e5ea7ac5c9e54863dbdf8259d299b43d5 Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:36:34 +0200 Subject: [PATCH 18/23] Revert implementation part of 0b4eb2a649dc84a2dd2b6dd2b6b61f2482ce8b48 --- src/mlx/warnings/polyspace_checker.py | 15 --------------- src/mlx/warnings/robot_checker.py | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index 46bec72a..e0326e73 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -113,20 +113,6 @@ def return_check_limits(self): count += checker.return_check_limits() return count - def config_parser(self, config, name): - ''' Parsing configuration dict extracted by previously opened JSON or YAML file - - Args: - config (dict): Content of configuration file - ''' - try: - from .warnings import substitute_envvar - - substitute_envvar(config, {'min', 'max'}) - print("Config parsing for {name} completed".format(name=name)) - except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) - def parse_config(self, config): """Parsing configuration dict extracted by previously opened JSON or yaml/yml file @@ -159,7 +145,6 @@ def parse_config(self, config): column_name = key.lower() check_value = value.lower() checker = PolyspaceFamilyChecker(family_value, column_name, check_value, verbose=self.verbose) - self.config_parser(check, f"{family_value} ({column_name}:{check_value})") checker.parse_config(check) checker.cq_findings = self.cq_findings # share object with sub-checkers self.checkers.append(checker) diff --git a/src/mlx/warnings/robot_checker.py b/src/mlx/warnings/robot_checker.py index c06ad0ad..5a1e7c04 100644 --- a/src/mlx/warnings/robot_checker.py +++ b/src/mlx/warnings/robot_checker.py @@ -88,27 +88,12 @@ def return_check_limits(self): count += checker.return_check_limits() return count - def config_parser(self, config, name): - ''' Parsing configuration dict extracted by previously opened JSON or YAML file - - Args: - config (dict): Content of configuration file - ''' - try: - from .warnings import substitute_envvar - - substitute_envvar(config, {'min', 'max'}) - print("Config parsing for suite {name!r} completed".format(name=name)) - except KeyError as err: - print("Incomplete config. Missing: {key}".format(key=err)) - def parse_config(self, config): self.checkers = [] check_suite_name = config.get('check_suite_names', True) for suite_config in config['suites']: checker = RobotSuiteChecker(suite_config['name'], check_suite_name=check_suite_name, verbose=self.verbose) - self.config_parser(suite_config, suite_config['name']) checker.parse_config(suite_config) self.checkers.append(checker) From 364686b1331a677ef50e3f26372b559681ff8d10 Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:40:24 +0200 Subject: [PATCH 19/23] Update test suite after 4923b47e5ea7ac5c9e54863dbdf8259d299b43d5 --- tests/test_integration.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index 00cca9d6..926400bf 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -189,7 +189,6 @@ def test_robot_verbose(self): self.assertEqual(1, retval) self.assertEqual( '\n'.join([ - "Config parsing for suite 'Suite Two' completed", "Suite One & Suite Two.Suite Two.Another test", "Suite 'Suite Two': 1 warnings found", "Counted failures for test suite 'Suite Two'.", @@ -211,10 +210,6 @@ def test_robot_config(self): self.assertEqual( '\n'.join([ - "Config parsing for suite 'Suite One' completed", - "Config parsing for suite '' completed", - "Config parsing for suite 'Suite Two' completed", - "Config parsing for suite 'b4d su1te name' completed", "Config parsing for robot completed", "Suite 'Suite One': 1 warnings found", "2 warnings found", @@ -246,9 +241,6 @@ def test_robot_config_check_names(self): self.assertEqual( '\n'.join([ - "Config parsing for suite 'b4d su1te name' completed", - "Config parsing for suite '' completed", - "Config parsing for suite 'Suite Two' completed", "Config parsing for robot completed", "ERROR: No suite with name 'b4d su1te name' found. Returning error code -1.", ]) + '\n', @@ -266,7 +258,6 @@ def test_robot_cli_check_name(self): self.assertEqual( '\n'.join([ - "Config parsing for suite 'Inv4lid Name' completed", "ERROR: No suite with name 'Inv4lid Name' found. Returning error code -1.", ]) + '\n', stdout_log From 47c1f70d8f81874697b7f79b29b2316413e4a95a Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:40:49 +0200 Subject: [PATCH 20/23] Improve readability of error msg --- src/mlx/warnings/polyspace_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index e0326e73..c821e902 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -154,7 +154,7 @@ def parse_config(self, config): "'Family' column. These dicts need to consist 3 key-value pairs (Note: if 'min' or " "'max' is not defined, it will get the default value of 0):\n" "{\n : ,\n min: ,\n max: \n};" - f"got {column_name} as column_name and {check_value} as value_to_check" + f"got {column_name!r} as column_name and {check_value!r} as value_to_check" ) for checker in self.checkers: checker.cq_enabled = self.cq_enabled From 5b79619ea2776c900b22ac4d6863a6c06505e36d Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:41:24 +0200 Subject: [PATCH 21/23] Substitute envvars in WarningsChecker.substitute_envvar --- src/mlx/warnings/warnings.py | 22 ---------------------- src/mlx/warnings/warnings_checker.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/mlx/warnings/warnings.py b/src/mlx/warnings/warnings.py index 948c5c2d..a098fb1a 100644 --- a/src/mlx/warnings/warnings.py +++ b/src/mlx/warnings/warnings.py @@ -5,12 +5,10 @@ import errno import glob import json -import os import subprocess import sys from importlib.metadata import distribution from pathlib import Path -from string import Template from ruamel.yaml import YAML @@ -23,25 +21,6 @@ __version__ = distribution('mlx.warnings').version -def substitute_envvar(checker_config, keys): - """Modifies configuration for checker in-place, resolving any environment variables for ``keys`` - - Args: - checker_config (dict): Configuration for a specific WarningsChecker - keys (set): Set of keys to process the value of - - Raises: - WarningsConfigError: Failed to find an environment variable - """ - for key in keys: - if key in checker_config and isinstance(checker_config[key], str): - template_obj = Template(checker_config[key]) - try: - checker_config[key] = template_obj.substitute(os.environ) - except KeyError as err: - raise WarningsConfigError(f"Failed to find environment variable {err} for configuration value {key!r}")\ - from None - class WarningsPlugin: @@ -229,7 +208,6 @@ def config_parser(self, config): try: checker_config = config[checker.name] if bool(checker_config['enabled']): - substitute_envvar(checker_config, {'min', 'max'}) self.activate_checker(checker) checker.parse_config(checker_config) print("Config parsing for {name} completed".format(name=checker.name)) diff --git a/src/mlx/warnings/warnings_checker.py b/src/mlx/warnings/warnings_checker.py index 8a655031..23d87e70 100644 --- a/src/mlx/warnings/warnings_checker.py +++ b/src/mlx/warnings/warnings_checker.py @@ -6,6 +6,26 @@ from .exceptions import WarningsConfigError +def substitute_envvar(checker_config, keys): + """Modifies configuration for checker inplace, resolving any environment variables for ``keys`` + + Args: + checker_config (dict): Configuration for a specific WarningsChecker + keys (set): Set of keys to process the value of + + Raises: + WarningsConfigError: Failed to find an environment variable + """ + for key in keys: + if key in checker_config and isinstance(checker_config[key], str): + template_obj = Template(checker_config[key]) + try: + checker_config[key] = template_obj.substitute(os.environ) + except KeyError as err: + raise WarningsConfigError(f"Failed to find environment variable {err} for configuration value {key!r}")\ + from None + + class WarningsChecker: name = 'checker' @@ -156,6 +176,7 @@ def print_when_verbose(self, message): print(message) def parse_config(self, config): + substitute_envvar(config, {'min', 'max'}) self.maximum = int(config['max']) self.minimum = int(config['min']) self.add_patterns(config.get("exclude"), self.exclude_patterns) From 191169414f5ff24d2fce95b32cc654502074503d Mon Sep 17 00:00:00 2001 From: jce Date: Thu, 25 Jul 2024 16:47:15 +0200 Subject: [PATCH 22/23] Remove redundant newline --- src/mlx/warnings/warnings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mlx/warnings/warnings.py b/src/mlx/warnings/warnings.py index a098fb1a..634fd56e 100644 --- a/src/mlx/warnings/warnings.py +++ b/src/mlx/warnings/warnings.py @@ -21,7 +21,6 @@ __version__ = distribution('mlx.warnings').version - class WarningsPlugin: def __init__(self, verbose=False, config_file=None, cq_enabled=False): From cd5200290041b3d2084a328a1d6006fd95e698c9 Mon Sep 17 00:00:00 2001 From: JWM Date: Thu, 25 Jul 2024 17:02:45 +0200 Subject: [PATCH 23/23] Delete minimum and maximum of docstring --- src/mlx/warnings/polyspace_checker.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index c821e902..f7e37b86 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -179,8 +179,6 @@ def __init__(self, family_value, column_name, check_value, **kwargs): family_value (str): The value to search for in the 'Family' column column_name (str): The name of the column check_value (str): The value to check in the column - minimum (int): The minimum amount the check_value can occur - maximum (int): The maximum amount the check_value can occur """ super().__init__(**kwargs) self.family_value = family_value