Skip to content

Commit 8c728f9

Browse files
committed
🔧 minimize the set of ignored ruff rules
1 parent ffa950e commit 8c728f9

File tree

11 files changed

+16
-68
lines changed

11 files changed

+16
-68
lines changed

‎pyproject.toml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,35 +180,26 @@ reportPrivateLocalImportUsage = true
180180
reportUnannotatedClassAttribute = false
181181
strictGenericNarrowing = true
182182

183+
183184
[tool.ruff]
184185
src = ["src", "tool"]
185186
extend-exclude = [".git", ".mypy_cache", ".tox", ".venv"]
186187
force-exclude = true
187-
# https://typing.python.org/en/latest/guides/writing_stubs.html#maximum-line-length
188188
line-length = 120
189189
preview = true
190190

191191
[tool.ruff.format]
192-
docstring-code-format = true
193192
line-ending = "lf"
194193

195194
[tool.ruff.lint]
196195
select = ["ALL"]
197-
ignore = [
198-
"FBT", # flake8-boolean-trap
199-
"CPY", # flake8-copyright
200-
"EM", # flake8-errmsg
201-
"FIX", # flake8-fixme
202-
"ANN401", # flake8-annotations: any-type
203-
"PYI041", # flake8-pyi: redundant-numeric-union
204-
]
196+
ignore = ["CPY", "FIX002"]
205197

206198
[tool.ruff.lint.per-file-ignores]
207199
"*.pyi" = [
208200
"N", # pep8-naming
209201
"TD", # flake8-todo
210202
"COM812", # flake8-commas: missing-trailing-comma
211-
"PYI054", # flake8-pyi: numeric-literal-too-long
212203
"PLC2701", # pylint/C: import-private-name
213204
]
214205

‎src/_numtype/.ruff.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,4 @@ extend = "../../pyproject.toml"
22
line-length = 120
33

44
[lint]
5-
extend-ignore = [
6-
"A", # flake8-builtins
7-
"PYI042", # flake8-pyi: snake-case-type-alias
8-
"PYI064", # flake8-pyi: redundant-final-literal
9-
"SLF001", # flake8-self: private-member-access
10-
"PLR2044", # pylint/R: empty-comment
11-
"PLR6301", # pylint/R: no-self-use
12-
"PLW3201", # pylint/W: bad-dunder-method-name
13-
]
5+
extend-ignore = ["PLR2044"] # pylint/R: empty-comment

‎src/numpy-stubs/.ruff.toml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,7 @@ line-length = 120
44
[lint]
55
extend-ignore = [
66
"A", # flake8-builtins
7-
"S404", # flake8-bandit: suspicious-subprocess-import
8-
"PYI042", # flake8-pyi: snake-case-type-alias # TODO
9-
"PYI047", # flake8-pyi: unused-private-type-alias # TODO
10-
"PYI064", # flake8-pyi: redundant-final-literal
11-
"SLF001", # flake8-self: private-member-access
12-
"E741", # pycodestyle/E: ambiguous-variable-name
13-
"E742", # pycodestyle/E: ambiguous-class-name
14-
"E743", # pycodestyle/E: ambiguous-function-name
15-
"PLR2044", # pylint/R: empty-comment
16-
"PLR6301", # pylint/R: no-self-use
17-
"PLR0904", # pylint/R: too-many-public-methods
18-
"PLR0913", # pylint/R: too-many-arguments
19-
"PLR0917", # pylint/R: too-many-positional-arguments
20-
"PLW3201", # pylint/W: bad-dunder-method-name
7+
"ANN401", # flake8-annotations: any-type
8+
"SLF001", # flake8-self: private-member-access
9+
"PLR2044", # pylint/R: empty-comment
2110
]

‎src/numpy-stubs/@test/.ruff.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ line-length = 88
44
[lint]
55
extend-ignore = [
66
"D", # pydocstyle
7-
"ERA", # eradicate
8-
"S", # flake8-bandit
9-
"T", # flake8-print
10-
"PLR2004", # pylint: magic-value-comparisons
7+
"FBT", # flake8-boolean-trap
8+
"PYI054", # flake8-pyi: numeric-literal-too-long
119
]

‎src/numpy-stubs/@test/generated/.ruff.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ line-length = 120
33

44
[lint]
55
extend-ignore = [
6-
"PTH", # flake8-use-pathlib
7-
"B015", # flake8-bugbear useless-comparison
86
"B018", # flake8-bugbear useless-expression
9-
"PYI015", # flake8-pyi: assignment-default-in-stub
10-
"PYI017", # flake8-pyi: complex-assignment-in-stub
11-
"SLF001", # flake8-self: private-member-access
127
"PLR0124", # pylint/R: comparison-with-itself
138
"PLC2801", # pylint/C: unnecessary-dunder-call
149
]

‎src/numpy-stubs/@test/runtime/.ruff.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,4 @@ extend-ignore = [
66
"ARG", # flake8-unused-arguments
77
"B015", # flake8-bugbear: useless-comparison
88
"B018", # flake8-bugbear: useless-expression
9-
"DTZ001", # flake8-datetimez: call-datetime-without-tzinfo
10-
"SLF001", # flake8-self: private-member-access
11-
"TD002", # flake8-todos: missing-todo-author
12-
"PLC2801", # pylint/C: unnecessary-dunder-call
13-
"PLR0124", # pylint/R: comparison-with-itself
14-
"PLR6301", # pylint/R: no-self-use
15-
"F841", # pyflakes: unused-variable
16-
"UP018", # pyupgrade: native-literals
17-
"RUF046", # ruff: unnecessary-cast-to-int
189
]

‎src/numpy-stubs/@test/static/.ruff.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ line-length = 120
33

44
[lint]
55
extend-ignore = [
6-
"PTH", # flake8-use-pathlib
7-
"PYI015", # flake8-pyi: assignment-default-in-stub
8-
"PYI017", # flake8-pyi: complex-assignment-in-stub
9-
"SLF001", # flake8-self: private-member-access
6+
"PYI015", # flake8-pyi: assignment-default-in-stub
7+
"PYI017", # flake8-pyi: complex-assignment-in-stub
8+
"SLF001", # flake8-self: private-member-access
9+
"PTH123", # flake8-use-pathlib: builtin-open
1010
]
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
extend = "../.ruff.toml"
22

33
[lint]
4-
extend-ignore = [
5-
"PT009", # flake8-pytest-style: pytest-unittest-assertion
6-
"PLR0124", # pylint/R: comparison-with-itself
7-
"PLC2801", # pylint/C: unnecessary-dunder-call
8-
]
4+
extend-ignore = ["PLR0124"] # pylint/R: comparison-with-itself

‎src/numpy-stubs/@test/static/reject/.ruff.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@ extend = "../.ruff.toml"
22
builtins = ["reveal_type"]
33

44
[lint]
5-
extend-ignore = [
6-
"B", # flake8-bugbear
7-
"PYI015", # flake8-pyi: assignment-default-in-stub
8-
"SIM300", # flake8-pyi: yoda-conditions
9-
]
5+
extend-ignore = ["B015", "B018"] # flake8-bugbear: useless-{comparison,expression}

‎src/numtype/@test/.ruff.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ extend = "../.ruff.toml"
33
[lint]
44
extend-ignore = [
55
"D", # pydocstyle
6-
"S", # flake8-bandit
7-
"PLR2004", # pylint: magic-value-comparisons
6+
"S101", # flake8-bandit: assert
87
]

0 commit comments

Comments
 (0)