diff --git a/src/mlx/warnings/junit_checker.py b/src/mlx/warnings/junit_checker.py index 80a7c94..76be340 100644 --- a/src/mlx/warnings/junit_checker.py +++ b/src/mlx/warnings/junit_checker.py @@ -57,8 +57,8 @@ def _check_testcase(self, testcase): """Handles the check of a test case element by checking if the result is a failure/error. If it is to be excluded by a configured regex, 1 is returned. - Otherwise, when in verbose/output mode, the suite name and test case name are printed/written along with the - failure/error message. + Otherwise, when in verbose/output mode, the suite name and test case name are printed/written + In output mode, the failure/error message is written additionally. Args: testcase (junitparser.TestCase): Test case element to check for failure or error diff --git a/src/mlx/warnings/polyspace_checker.py b/src/mlx/warnings/polyspace_checker.py index b188e24..25024a0 100644 --- a/src/mlx/warnings/polyspace_checker.py +++ b/src/mlx/warnings/polyspace_checker.py @@ -125,7 +125,6 @@ def parse_config(self, config): {\n : ,\n min: ,\n max: \n} """ self.checkers = [] - padding = 0 for family_value, data in config.items(): if family_value == "enabled": continue @@ -144,7 +143,6 @@ def parse_config(self, config): continue column_name = key.lower() check_value = value.lower() - padding = max(padding, len(f"{family_value}: {column_name}: {check_value}")) checker = PolyspaceFamilyChecker(family_value, column_name, check_value, *self.logging_args) checker.parse_config(check) self.checkers.append(checker) @@ -165,7 +163,6 @@ def parse_config(self, config): class PolyspaceFamilyChecker(WarningsChecker): name = "polyspace_sub" - subchecker = True code_quality_severity = { "impact: high": "critical", "impact: medium": "major", diff --git a/src/mlx/warnings/regex_checker.py b/src/mlx/warnings/regex_checker.py index c772fc5..0fa4cf2 100644 --- a/src/mlx/warnings/regex_checker.py +++ b/src/mlx/warnings/regex_checker.py @@ -170,7 +170,6 @@ def parse_config(self, config): class CoverityClassificationChecker(WarningsChecker): name = "coverity_sub" - subchecker = True logging_fmt = "{checker.name_repr}: {checker.classification:<14} | {message}" SEVERITY_MAP = { "false positive": "info", diff --git a/src/mlx/warnings/robot_checker.py b/src/mlx/warnings/robot_checker.py index 4847fb2..93146fd 100644 --- a/src/mlx/warnings/robot_checker.py +++ b/src/mlx/warnings/robot_checker.py @@ -92,7 +92,6 @@ def parse_config(self, config): class RobotSuiteChecker(JUnitChecker): name = "robot_sub" - subchecker = True logging_fmt = "{checker.name_repr}: {checker.suite_name_repr:<20} {message}" def __init__(self, suite_name, *logging_args, check_suite_name=False): diff --git a/src/mlx/warnings/warnings_checker.py b/src/mlx/warnings/warnings_checker.py index 51e0063..bb075b6 100644 --- a/src/mlx/warnings/warnings_checker.py +++ b/src/mlx/warnings/warnings_checker.py @@ -39,7 +39,6 @@ def filter(self, record: logging.LogRecord) -> bool: class WarningsChecker: name = "checker" - subchecker = False logging_fmt = "{checker.name_repr}: {message}" def __init__(self, verbose, output): @@ -92,6 +91,10 @@ def __init__(self, verbose, output): def name_repr(self): return self.name.replace("_sub", "").capitalize() + @property + def is_sub_checker(self): + return self.name.endswith("_sub") + @property def cq_findings(self): """List[dict]: list of code quality findings""" @@ -209,7 +212,7 @@ def _return_error_code(self): if error_code == 0: error_code = 1 string_to_print = f"number of warnings ({self.count}) is {error_reason}." - if not self.subchecker: + if not self.is_sub_checker: string_to_print += f" Returning error code {error_code}." self.logger.warning(string_to_print) return error_code