Skip to content

Commit fc669cc

Browse files
authored
Merge pull request #1871 from EliahKagan/ruff
Slightly broaden Ruff, and update and clarify tool configuration
2 parents 7734921 + ff1ebf8 commit fc669cc

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

.pre-commit-config.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
repos:
2-
32
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.3.0
3+
rev: v0.3.2
54
hooks:
65
- id: ruff-format
76
exclude: ^git/ext/
87
- id: ruff
98
args: ["--fix"]
10-
exclude: ^doc|^git/ext/
9+
exclude: ^git/ext/
1110

1211
- repo: https://github.com/shellcheck-py/shellcheck-py
13-
rev: v0.9.0.5
12+
rev: v0.9.0.6
1413
hooks:
1514
- id: shellcheck
1615
args: [--color]
1716
exclude: ^test/fixtures/polyglot$|^git/ext/
1817

1918
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: v4.4.0
19+
rev: v4.5.0
2120
hooks:
2221
- id: check-toml
2322
- id: check-yaml

pyproject.toml

+17-14
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,34 @@ line-length = 120
4848
# Exclude a variety of commonly ignored directories.
4949
exclude = [
5050
"git/ext/",
51-
"doc",
5251
"build",
5352
"dist",
5453
]
5554
# Enable Pyflakes `E` and `F` codes by default.
5655
lint.select = [
5756
"E",
58-
"W", # see: https://pypi.org/project/pycodestyle
59-
"F", # see: https://pypi.org/project/pyflakes
60-
# "I", #see: https://pypi.org/project/isort/
61-
# "S", # see: https://pypi.org/project/flake8-bandit
62-
# "UP", # see: https://docs.astral.sh/ruff/rules/#pyupgrade-up
57+
"W", # See: https://pypi.org/project/pycodestyle
58+
"F", # See: https://pypi.org/project/pyflakes
59+
# "I", # See: https://pypi.org/project/isort/
60+
# "S", # See: https://pypi.org/project/flake8-bandit
61+
# "UP", # See: https://docs.astral.sh/ruff/rules/#pyupgrade-up
6362
]
6463
lint.extend-select = [
65-
#"A", # see: https://pypi.org/project/flake8-builtins
66-
"B", # see: https://pypi.org/project/flake8-bugbear
67-
"C4", # see: https://pypi.org/project/flake8-comprehensions
68-
"TCH004", # see: https://docs.astral.sh/ruff/rules/runtime-import-in-type-checking-block/
64+
# "A", # See: https://pypi.org/project/flake8-builtins
65+
"B", # See: https://pypi.org/project/flake8-bugbear
66+
"C4", # See: https://pypi.org/project/flake8-comprehensions
67+
"TCH004", # See: https://docs.astral.sh/ruff/rules/runtime-import-in-type-checking-block/
6968
]
7069
lint.ignore = [
71-
"E203",
72-
"E731", # Do not assign a `lambda` expression, use a `def`
70+
"E203", # Whitespace before ':'
71+
"E731", # Do not assign a `lambda` expression, use a `def`
7372
]
7473
lint.ignore-init-module-imports = true
75-
lint.unfixable = ["F401"]
74+
lint.unfixable = [
75+
"F401", # Module imported but unused
76+
]
7677

7778
[tool.ruff.lint.per-file-ignores]
78-
"test/**" = ["B018"]
79+
"test/**" = [
80+
"B018", # useless-expression
81+
]

requirements-dev.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
-r requirements.txt
22
-r test-requirements.txt
33

4-
# libraries for additional local testing/linting - to be added to test-requirements.txt when all pass
5-
4+
# For additional local testing/linting - to be added elsewhere eventually.
5+
ruff
6+
shellcheck
67
pytest-icdiff
78
# pytest-profiling

0 commit comments

Comments
 (0)