diff --git a/pyproject.toml b/pyproject.toml index e972c00ce..67d3c5b36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -212,6 +212,7 @@ ignore_missing_imports = true fail-under = 10.0 suggestion-mode = true # Remove this setting when pylint v4 is released. load-plugins = [ + "pylint.extensions.redefined_variable_type", # https://github.com/pylint-dev/pylint/issues/8955 ] disable = [ "fixme", @@ -230,7 +231,6 @@ disable = [ "too-many-public-methods", "too-many-return-statements", "too-many-statements", - "too-many-try-statements", "duplicate-code", ] diff --git a/src/macaron/slsa_analyzer/checks/build_as_code_check.py b/src/macaron/slsa_analyzer/checks/build_as_code_check.py index 0a0f95c48..4e0c839f1 100644 --- a/src/macaron/slsa_analyzer/checks/build_as_code_check.py +++ b/src/macaron/slsa_analyzer/checks/build_as_code_check.py @@ -202,7 +202,7 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData: confidence=Confidence.HIGH, ) ) - overall_res = CheckResultType.PASSED + overall_res = CheckResultType.PASSED # pylint: disable=redefined-variable-type try: for build_command in ci_service.get_build_tool_commands( callgraph=ci_info["callgraph"], build_tool=tool @@ -263,7 +263,7 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData: confidence=confidence, ) ) - overall_res = CheckResultType.PASSED + overall_res = CheckResultType.PASSED # pylint: disable=redefined-variable-type except CallGraphError as error: logger.debug(error) @@ -292,7 +292,7 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData: confidence=Confidence.LOW, ) ) - overall_res = CheckResultType.PASSED + overall_res = CheckResultType.PASSED # pylint: disable=redefined-variable-type # The check passing is contingent on at least one passing, if # one passes treat whole check as passing. We do still need to diff --git a/src/macaron/slsa_analyzer/checks/build_service_check.py b/src/macaron/slsa_analyzer/checks/build_service_check.py index c5f43c484..c96d95790 100644 --- a/src/macaron/slsa_analyzer/checks/build_service_check.py +++ b/src/macaron/slsa_analyzer/checks/build_service_check.py @@ -164,7 +164,7 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData: confidence=confidence, ) ) - overall_res = CheckResultType.PASSED + overall_res = CheckResultType.PASSED # pylint: disable=redefined-variable-type except CallGraphError as error: logger.debug(error) @@ -193,7 +193,7 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData: confidence=Confidence.LOW, ) ) - overall_res = CheckResultType.PASSED + overall_res = CheckResultType.PASSED # pylint: disable=redefined-variable-type # The check passing is contingent on at least one passing, if # one passes treat whole check as passing. We do still need to diff --git a/src/macaron/slsa_analyzer/checks/provenance_l3_check.py b/src/macaron/slsa_analyzer/checks/provenance_l3_check.py index e34a4ce0b..3795b2ba0 100644 --- a/src/macaron/slsa_analyzer/checks/provenance_l3_check.py +++ b/src/macaron/slsa_analyzer/checks/provenance_l3_check.py @@ -451,8 +451,7 @@ class Feedback(NamedTuple): result_value = CheckResultType.FAILED else: result_tables.append(ProvenanceL3VerifiedFacts(confidence=Confidence.HIGH)) - result_value = CheckResultType.PASSED - return CheckResultData(result_tables=result_tables, result_type=result_value) + return CheckResultData(result_tables=result_tables, result_type=CheckResultType.PASSED) return CheckResultData(result_tables=result_tables, result_type=result_value)