Skip to content

Commit 75e7531

Browse files
A few ruff details
- The proper hook for the linter is `ruff-check` nowadays. - Use `extend-select` and let the linter chose its default rule sets - compatible with formatters. - No need to specify the directory to check, ruff operates on `.` by default. - The `debug-statements` hook can be replaced by Ruff debugger (T100) rules if needed.
1 parent f4f0688 commit 75e7531

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
rev: v0.15.4
44
hooks:
5-
- id: ruff
6-
args: [--fix]
5+
- id: ruff-check
6+
args: ["--fix", "--show-fixes"]
77
- id: ruff-format
88
- repo: https://github.com/pre-commit/pre-commit-hooks
99
rev: v6.0.0
1010
hooks:
1111
- id: trailing-whitespace
1212
- id: check-yaml
13-
- id: debug-statements
14-
language_version: python3

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ dev = [
4747
line-length = 99
4848

4949
[tool.ruff.lint]
50-
select = ["E", "F", "W", "C90"]
51-
ignore = ["E203", "E402", "E721", "C901"]
50+
extend-select = ["W", "C90"]
51+
ignore = ["E721", "C901"]
5252

5353
[tool.ruff.lint.mccabe]
5454
max-complexity = 22

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ passenv =
3030

3131
[testenv:lint]
3232
commands =
33-
ruff check .
34-
ruff format --check .
33+
ruff check
34+
ruff format --check
3535
deps =
3636
ruff
3737

0 commit comments

Comments
 (0)