Skip to content
Open
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)$
Expand Down
2 changes: 1 addition & 1 deletion codesorter/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions codesorter/sort_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down Expand Up @@ -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]:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sort_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down