diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c06f55f..a82ef4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: id: ruff - id: ruff-format repo: https://github.com/astral-sh/ruff-pre-commit - rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20 + rev: 2700fd5671c633760d912769c041bfcde2b9a01b # frozen: v0.15.22 - hooks: - files: ^(.*\.toml)$ diff --git a/codesorter/cli.py b/codesorter/cli.py index f33d276..c05fb96 100644 --- a/codesorter/cli.py +++ b/codesorter/cli.py @@ -93,7 +93,7 @@ def _check_files(*, files: list[str]) -> int: continue try: new_tree = SortCodeCommand(CodemodContext()).transform_module(cst.parse_module(source)) - except Exception as exc: # noqa: BLE001 + except Exception as exc: # ruff:ignore[blind-except] sys.stderr.write(f"{path}: transform error: {exc}\n") failed.append(path) continue diff --git a/codesorter/sort_code.py b/codesorter/sort_code.py index e20d3bc..27bb4ab 100644 --- a/codesorter/sort_code.py +++ b/codesorter/sort_code.py @@ -365,7 +365,7 @@ def _fold_runtime_dependencies(self) -> None: for callee in callees: self.dependencies[name].update(runtime.get(callee, ())) - def _get_dependencies( # noqa: C901 + def _get_dependencies( # ruff:ignore[complex-structure] self, node: _Sortable, ) -> tuple[list[str], md.Scope]: @@ -490,7 +490,7 @@ def _is_order_sensitive_class(self, node: cst.ClassDef) -> bool: return True return False - def _node_sort_key( # noqa: C901 + def _node_sort_key( # ruff:ignore[complex-structure] self, node: _Sortable, ) -> tuple[int, int, MethodType, FixtureType, bool, str, PropertyType]: diff --git a/tests/test_sort_code.py b/tests/test_sort_code.py index 5c28257..8c6468f 100644 --- a/tests/test_sort_code.py +++ b/tests/test_sort_code.py @@ -225,8 +225,8 @@ def test_fixture_files_execute(self): try: code = compile(path.read_text(encoding="utf-8"), str(path), "exec") with redirect_stdout(captured), redirect_stderr(captured): - exec(code, {"__name__": "__fixture__"}) # noqa: S102 - except Exception as error: # noqa: BLE001 + exec(code, {"__name__": "__fixture__"}) # ruff:ignore[exec-builtin] + except Exception as error: # ruff:ignore[blind-except] failures.append(f"{path.name}: {type(error).__name__}: {error}") continue if captured.getvalue():