Skip to content

Commit a042cf7

Browse files
committed
chore: update ruff pre-commit hooks to best practices
- Update hook ID from 'ruff' to 'ruff-check' (preferred) - Update version from v0.14.5 to v0.14.9 - Add type filters 'types_or: [python, pyi]' to avoid running on Jupyter notebooks - Add comments for clarity - Ensure proper ordering: ruff-check with --fix before ruff-format Follows https://github.com/astral-sh/ruff-pre-commit best practices
1 parent 688d7ee commit a042cf7

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ repos:
2323
args: [--markdown-linebreak-ext=md]
2424

2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.14.5
26+
rev: v0.14.9
2727
hooks:
28-
- id: ruff
28+
# Run the linter with fixes.
29+
- id: ruff-check
30+
types_or: [python, pyi]
2931
args: ["--fix"]
3032
- id: ruff-format
33+
types_or: [python, pyi]

.pre-commit-config.yaml.jinja

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ repos:
2424
args: [--markdown-linebreak-ext=md]
2525

2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.14.5
27+
rev: v0.14.9
2828
hooks:
29-
- id: ruff
29+
# Run the linter with fixes.
30+
- id: ruff-check
31+
types_or: [python, pyi]
3032
args: ["--fix"]
3133
- id: ruff-format
34+
types_or: [python, pyi]

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ addopts = "--durations=5 --durations-min=0.0 --tb=short"
4747
filterwarnings = [
4848
"ignore:Dirty template changes included automatically:copier._vcs.DirtyLocalWarning",
4949
]
50+
51+
[tool.ruff]
52+
line-length = 120
53+
target-version = "py310"

pyproject.toml.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ addopts = [
4141
[tool.coverage.run]
4242
source = ["src"]
4343
omit = ["*/tests/*"]
44+
4445
{%- if "ruff" in dev_deps %}
4546
[tool.ruff]
46-
line-length = 88
47+
line-length = 120
4748
target-version = "py310"
4849

4950
[tool.ruff.lint]

0 commit comments

Comments
 (0)