Skip to content

Commit ae6be02

Browse files
A few ruff details
- The proper hook for the linter is `ruff-check` nowadays. - Use `extend-select` and let the linter choose 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. - Add the `end-of-file-fixer` hook.
1 parent f4f0688 commit ae6be02

5 files changed

Lines changed: 9 additions & 11 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ 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:
11+
- id: end-of-file-fixer
1112
- id: trailing-whitespace
1213
- id: check-yaml
13-
- id: debug-statements
14-
language_version: python3

HOWTOPUBLISH

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ git push # wait for all CI builds to succeed
1414
git push --tags # if CI builds succeed
1515
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
1616
twine upload dist/*
17-
# use __token__ as username andPyPI API token as password (generate at pypi.org → Account settings → API tokens)
17+
# use __token__ as username andPyPI API token as password (generate at pypi.org → Account settings → API tokens)

benchmark/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
prettytable
2-
texttable
2+
texttable

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 & 3 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

@@ -147,4 +147,3 @@ deps =
147147
numpy
148148
pandas
149149
wcwidth
150-

0 commit comments

Comments
 (0)