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 black and flake8 issues for the new versions of the tools #362

Merged
merged 1 commit into from
Jul 16, 2023
Merged
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
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
}
html_static_path = ["_static"]


# We add the docstrings for class constructors in the `__init__` methods.
def skip(app, what, name, obj, would_skip, options):
if name == "__init__":
Expand Down
3 changes: 1 addition & 2 deletions src/macaron/parsers/bashparser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022 - 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.

"""This module is a Python wrapper for the compiled bashparser binary.
Expand Down Expand Up @@ -157,7 +157,6 @@ def extract_bash_from_ci(
# Parse the bash script files called from the current script.
if recursive and repo_path:
for cmd in caller_commands:

# Parse the scripts that end with `.sh`.
# We only parse recursively at depth 1, so don't set the recursive argument in parse_file().
# TODO: parse Makefiles for bash commands.
Expand Down
1 change: 0 additions & 1 deletion src/macaron/slsa_analyzer/checks/build_as_code_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def _has_deploy_command(self, commands: list[list[str]], build_tool: BaseBuildTo
# Account for Python projects having separate tools for packaging and publishing.
deploy_tool = build_tool.publisher if build_tool.publisher else build_tool.builder
for com in commands:

# Check for empty or invalid commands.
if not com or not com[0]:
continue
Expand Down
1 change: 0 additions & 1 deletion src/macaron/slsa_analyzer/checks/provenance_l3_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ class Feedback(NamedTuple):
with tempfile.TemporaryDirectory() as temp_path:
downloaded_provs = []
for prov_asset in prov_assets:

# Check the size before downloading.
if self._size_large(prov_asset["size"]):
logger.info("Skip verifying the provenance %s: asset size too large.", prov_asset["name"])
Expand Down
1 change: 0 additions & 1 deletion src/macaron/slsa_analyzer/database_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def store_analyze_context_to_db(db_man: DatabaseManager, analysis: AnalysisTable

# Store check result table
for check in analyze_ctx.check_results.values():

check_table = CheckResultTable()
check_table.check_id = check["check_id"]
check_table.repository = analyze_ctx.repository_table.id
Expand Down
6 changes: 4 additions & 2 deletions tests/slsa_analyzer/checks/base_check/test_base_check.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022 - 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.

"""This module contains the tests for BaseCheck."""
Expand All @@ -12,8 +12,10 @@
class TestConfiguration(TestCase):
"""This class contains the tests for BaseCheck."""

# Disable flake8's D202 check: "No blank lines allowed after function docstring"
def test_raise_implementation_error(self) -> None:
"""Test raising errors if child class does not override abstract method(s)."""
"""Test raising errors if child class does not override abstract method(s).""" # noqa: D202

# pylint: disable=abstract-method
class ChildCheck(BaseCheck):
"""This class is a child class that does not implement abstract methods in Base Check."""
Expand Down