Skip to content

Commit 89761d9

Browse files
authored
chore: fix black and flake8 issues for the new versions of the tools (#362)
Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
1 parent 9ca5e9b commit 89761d9

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
}
5858
html_static_path = ["_static"]
5959

60+
6061
# We add the docstrings for class constructors in the `__init__` methods.
6162
def skip(app, what, name, obj, would_skip, options):
6263
if name == "__init__":

src/macaron/parsers/bashparser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 - 2022, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

44
"""This module is a Python wrapper for the compiled bashparser binary.
@@ -157,7 +157,6 @@ def extract_bash_from_ci(
157157
# Parse the bash script files called from the current script.
158158
if recursive and repo_path:
159159
for cmd in caller_commands:
160-
161160
# Parse the scripts that end with `.sh`.
162161
# We only parse recursively at depth 1, so don't set the recursive argument in parse_file().
163162
# TODO: parse Makefiles for bash commands.

src/macaron/slsa_analyzer/checks/build_as_code_check.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def _has_deploy_command(self, commands: list[list[str]], build_tool: BaseBuildTo
7070
# Account for Python projects having separate tools for packaging and publishing.
7171
deploy_tool = build_tool.publisher if build_tool.publisher else build_tool.builder
7272
for com in commands:
73-
7473
# Check for empty or invalid commands.
7574
if not com or not com[0]:
7675
continue

src/macaron/slsa_analyzer/checks/provenance_l3_check.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ class Feedback(NamedTuple):
351351
with tempfile.TemporaryDirectory() as temp_path:
352352
downloaded_provs = []
353353
for prov_asset in prov_assets:
354-
355354
# Check the size before downloading.
356355
if self._size_large(prov_asset["size"]):
357356
logger.info("Skip verifying the provenance %s: asset size too large.", prov_asset["name"])

src/macaron/slsa_analyzer/database_store.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def store_analyze_context_to_db(db_man: DatabaseManager, analysis: AnalysisTable
5050

5151
# Store check result table
5252
for check in analyze_ctx.check_results.values():
53-
5453
check_table = CheckResultTable()
5554
check_table.check_id = check["check_id"]
5655
check_table.repository = analyze_ctx.repository_table.id

tests/slsa_analyzer/checks/base_check/test_base_check.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 - 2022, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2022 - 2023, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

44
"""This module contains the tests for BaseCheck."""
@@ -12,8 +12,10 @@
1212
class TestConfiguration(TestCase):
1313
"""This class contains the tests for BaseCheck."""
1414

15+
# Disable flake8's D202 check: "No blank lines allowed after function docstring"
1516
def test_raise_implementation_error(self) -> None:
16-
"""Test raising errors if child class does not override abstract method(s)."""
17+
"""Test raising errors if child class does not override abstract method(s).""" # noqa: D202
18+
1719
# pylint: disable=abstract-method
1820
class ChildCheck(BaseCheck):
1921
"""This class is a child class that does not implement abstract methods in Base Check."""

0 commit comments

Comments
 (0)