Skip to content

Commit f448dca

Browse files
correctmostDanielNoord
authored andcommitted
Move most ruff exclusions out of .pre-commit-config.yaml
This makes it easier to run 'ruff check' outside of the pre-commit hooks.
1 parent a82e2fe commit f448dca

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,10 @@ repos:
2121
hooks:
2222
- id: ruff
2323
args: ["--fix"]
24-
exclude: &fixtures tests(/\w*)*/functional/|tests/input|doc/data/messages|tests(/\w*)*data/
24+
exclude: doc/data/messages
2525
- id: ruff
2626
name: ruff-doc
2727
files: doc/data/messages
28-
exclude: |
29-
(?x)^(
30-
doc/data/messages/d/duplicate-argument-name/bad.py|
31-
doc/data/messages/s/syntax-error/bad.py
32-
)$
33-
34-
args: ["--config", "doc/data/ruff.toml"]
3528
- repo: https://github.com/Pierre-Sassoulas/copyright_notice_precommit
3629
rev: 0.1.2
3730
hooks:
@@ -49,7 +42,7 @@ repos:
4942
hooks:
5043
- id: black
5144
args: [--safe, --quiet]
52-
exclude: *fixtures
45+
exclude: &fixtures tests(/\w*)*/functional/|tests/input|doc/data/messages|tests(/\w*)*data/
5346
- id: black
5447
name: black-doc
5548
args: [--safe, --quiet]

doc/data/ruff.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
# (Because of horizontal scrolling)
33
line-length = 103
44

5+
extend-exclude = [
6+
"messages/d/duplicate-argument-name/bad.py",
7+
"messages/s/syntax-error/bad.py",
8+
]
9+
510
[lint]
611
ignore = []
712
select = ["E501", "I"]
813

914

1015
[lint.per-file-ignores]
11-
"doc/data/messages/r/reimported/bad.py" = ["I"]
12-
"doc/data/messages/w/wrong-import-order/bad.py" = ["I"]
13-
"doc/data/messages/u/ungrouped-imports/bad.py" = ["I"]
14-
"doc/data/messages/m/misplaced-future/bad.py" = ["I"]
15-
"doc/data/messages/m/multiple-imports/bad.py" = ["I"]
16+
"messages/m/misplaced-future/bad.py" = ["I"]
17+
"messages/m/multiple-imports/bad.py" = ["I"]
18+
"messages/r/reimported/bad.py" = ["I"]
19+
"messages/u/ungrouped-imports/bad.py" = ["I"]
20+
"messages/w/wrong-import-order/bad.py" = ["I"]

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ module = [
145145
# (for docstrings, strings and comments in particular).
146146
line-length = 115
147147

148+
extend-exclude = [
149+
"tests/**/data/",
150+
"tests/**/functional/",
151+
"tests/input/",
152+
"tests/regrtest_data/",
153+
]
154+
148155
[tool.ruff.lint]
149156
select = [
150157
"B", # bugbear

0 commit comments

Comments
 (0)