Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix pylint message redefined-variable-type #889

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -230,7 +231,6 @@ disable = [
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
"too-many-try-statements",
"duplicate-code",
]

Expand Down
6 changes: 3 additions & 3 deletions src/macaron/slsa_analyzer/checks/build_as_code_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/macaron/slsa_analyzer/checks/build_service_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/macaron/slsa_analyzer/checks/provenance_l3_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading