Skip to content

Commit d9027e8

Browse files
authored
Adopt more modern ruff pre-commit hook config (#213)
* Adopt more modern ruff pre-commit hook config - Avoids using the legacy ruff command and uses the two current hooks. - Moves options to pyproject.toml to make external ruff calls in sync with pre-commit ones - Adds 'ruff' alias, so users can easily call both hooks with: pre-commit run -a ruff - Updates ruff hook version * Adopt more modern ruff pre-commit hook config - Avoids using the legacy ruff command and uses the two current hooks. - Moves options to pyproject.toml to make external ruff calls in sync with pre-commit ones - Adds 'ruff' alias, so users can easily call both hooks with: pre-commit run -a ruff - Updates ruff hook version
1 parent 89bc423 commit d9027e8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ repos:
2424
hooks:
2525
- id: pyproject-fmt
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: "v0.11.13"
27+
rev: "v0.12.0"
2828
hooks:
2929
- id: ruff-format
30-
- id: ruff
31-
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
30+
alias: ruff
31+
args: ["--exit-non-zero-on-format"]
32+
- id: ruff-check
33+
alias: ruff
34+
args: ["--exit-non-zero-on-fix"]
3235
- repo: https://github.com/rbubley/mirrors-prettier
3336
rev: "v3.5.3"
3437
hooks:

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ version.source = "vcs"
8080

8181
[tool.ruff]
8282
line-length = 120
83+
fix = true
84+
unsafe-fixes = true
8385
format.preview = true
8486
format.docstring-code-line-length = 100
8587
format.docstring-code-format = true

0 commit comments

Comments
 (0)