diff --git a/glitch/__main__.py b/glitch/__main__.py index a9a7dd7..db97492 100644 --- a/glitch/__main__.py +++ b/glitch/__main__.py @@ -39,7 +39,7 @@ def __parse_and_check( ) -> Set[Error]: errors: Set[Error] = set() inter = parser.parse(path, type, module) - # Avoids problems with multiple threads (and possibly multiple files) + # Avoids problems with multiple threads (and possibly multiple files) # sharing the same object analyses = deepcopy(analyses) diff --git a/glitch/analysis/design/long_statement.py b/glitch/analysis/design/long_statement.py index 6f1c60d..b8e77f3 100644 --- a/glitch/analysis/design/long_statement.py +++ b/glitch/analysis/design/long_statement.py @@ -11,9 +11,7 @@ def check(self, element: CodeElement, file: str) -> List[Error]: if isinstance(element, UnitBlock) and element.type != UnitBlockType.block: for i, line in enumerate(self.code_lines): if len(line) > 140: - error = Error( - "implementation_long_statement", element, file, line - ) + error = Error("implementation_long_statement", element, file, line) error.line = i + 1 errors.append(error) diff --git a/glitch/parsers/gha.py b/glitch/parsers/gha.py index 76af38e..e04cfb7 100644 --- a/glitch/parsers/gha.py +++ b/glitch/parsers/gha.py @@ -93,7 +93,10 @@ def __parse_job(self, key: Node, value: Node, lines: List[str]) -> UnitBlock: au_type = step_dict["uses"] au = AtomicUnit(name, au_type) - au.line, au.column = step.start_mark.line + 1, step.start_mark.column + 1 + au.line, au.column = ( + step.start_mark.line + 1, + step.start_mark.column + 1, + ) au.code = GithubActionsParser._get_code(step, step, lines) for key, value in step.value: diff --git a/glitch/tests/design/gha/test_design.py b/glitch/tests/design/gha/test_design.py index c6c0ed2..9654958 100644 --- a/glitch/tests/design/gha/test_design.py +++ b/glitch/tests/design/gha/test_design.py @@ -1,7 +1,7 @@ import unittest from glitch.analysis.design.visitor import DesignVisitor -from glitch.analysis.rules import Error +from glitch.analysis.rules import Error from glitch.parsers.gha import GithubActionsParser from glitch.tech import Tech from glitch.repr.inter import UnitBlockType @@ -9,7 +9,9 @@ class TestDesign(unittest.TestCase): - def __help_test(self, path: str, n_errors: int, codes: List[str], lines: List[int]) -> None: + def __help_test( + self, path: str, n_errors: int, codes: List[str], lines: List[int] + ) -> None: parser = GithubActionsParser() inter = parser.parse(path, UnitBlockType.script, False) assert inter is not None @@ -20,7 +22,7 @@ def __help_test(self, path: str, n_errors: int, codes: List[str], lines: List[in filter( lambda e: e.code.startswith("design_") or e.code.startswith("implementation_"), - errors + errors, ) ) errors = sorted(errors, key=lambda e: (e.path, e.line, e.code))