@@ -61,16 +61,16 @@ postgres = [
61
61
" psycopg[binary]" ,
62
62
]
63
63
mysql = [
64
- " mysqlclient==2.1.0 " ,
64
+ " mysqlclient==2.2.7 " ,
65
65
]
66
66
xdist = [
67
67
" pytest-xdist" ,
68
68
]
69
69
linting = [
70
70
" editorconfig-checker==3.2.1" ,
71
- " mypy==1.15.0 " ,
72
- " ruff==0.9.5 " ,
73
- " zizmor==1.9 .0" ,
71
+ " mypy==1.17.1 " ,
72
+ " ruff==0.12.8 " ,
73
+ " zizmor==1.11 .0" ,
74
74
]
75
75
[project .urls ]
76
76
Documentation = " https://pytest-django.readthedocs.io/"
@@ -133,33 +133,169 @@ exclude_lines = [
133
133
]
134
134
135
135
[tool .ruff ]
136
+ # preview = true # TODO: Enable this when we have the bandwidth
136
137
line-length = 99
137
138
extend-exclude = [
138
139
" pytest_django/_version.py" ,
139
140
]
140
141
141
142
[tool .ruff .lint ]
142
143
extend-select = [
143
- " B" , # flake8-bugbear
144
+ " AIR" , # Airflow
145
+ " ERA" , # eradicate
146
+ " FAST" , # FastAPI
147
+ " YTT" , # flake8-2020
148
+ " ANN" , # flake8-annotations
149
+ " ASYNC" , # flake8-async
150
+ " S" , # flake8-bandit
144
151
" BLE" , # flake8-blind-except
152
+ " FBT" , # flake8-boolean-trap
153
+ " B" , # flake8-bugbear
154
+ " A" , # flake8-builtins
155
+ " COM" , # flake8-commas
156
+ " C4" , # flake8-comprehensions
157
+ " CPY" , # flake8-copyright
145
158
" DTZ" , # flake8-datetimez
159
+ " T10" , # flake8-debugger
160
+ " DJ" , # flake8-django
161
+ " EM" , # flake8-errmsg
162
+ " EXE" , # flake8-executable
163
+ " FIX" , # flake8-fixme
146
164
" FA" , # flake8-future-annotations
165
+ " INT" , # flake8-gettext
166
+ " ISC" , # flake8-implicit-str-concat
167
+ " ICN" , # flake8-import-conventions
168
+ " LOG" , # flake8-logging
147
169
" G" , # flake8-logging-format
148
- " I" , # isort
149
- " PGH" , # pygrep-hooks
170
+ " INP" , # flake8-no-pep420
150
171
" PIE" , # flake8-pie
151
- " PL" , # pylint
152
- " PT" , # flake8-pytest-style
172
+ " T20" , # flake8-print
153
173
" PYI" , # flake8-pyi
154
- " RUF" , # Ruff-specific rules
174
+ " PT" , # flake8-pytest-style
175
+ " Q" , # flake8-quotes
176
+ " RSE" , # flake8-raise
177
+ " RET" , # flake8-return
178
+ " SLF" , # flake8-self
179
+ " SIM" , # flake8-simplify
155
180
" SLOT" , # flake8-slots
156
- " T10" , # flake8-debugger
181
+ " TID" , # flake8-tidy-imports
182
+ " TD" , # flake8-todos
183
+ " TC" , # flake8-type-checking
184
+ " ARG" , # flake8-unused-arguments
185
+ " PTH" , # flake8-use-pathlib
186
+ " FLY" , # flynt
187
+ " I" , # isort
188
+ " C90" , # mccabe
189
+ " PD" , # pandas-vet
190
+ " N" , # pep8-naming
191
+ " PERF" , # Perflint
192
+ " E" , # pycodestyle Error
193
+ " W" , # pycodestyle Warning
194
+ " DOC" , # pydoclint
195
+ " D" , # pydocstyle
196
+ " F" , # Pyflakes
197
+ " PGH" , # pygrep-hooks
198
+ " PL" , # Pylint
157
199
" UP" , # pyupgrade
158
- " YTT" , # flake8-2020
200
+ " FURB" , # refurb
201
+ " TRY" , # tryceratops
202
+ " RUF" , # Ruff-specific rules
159
203
]
160
204
ignore = [
161
- " PLR0913" , # Too many arguments in function definition
162
- " PLR2004" , # Magic value used in comparison, consider replacing 3 with a constant variable
205
+ " ANN401" , # Dynamically typed expressions (typing.Any) are disallowed
206
+ " D100" , # Missing docstring in public module
207
+ " D101" , # Missing docstring in public class
208
+ " D102" , # Missing docstring in public method
209
+ " D103" , # Missing docstring in public function
210
+ " D104" , # Missing docstring in public package
211
+ " D105" , # Missing docstring in magic method
212
+ " D107" , # Missing docstring in __init__
213
+ " D200" , # One-line docstring should fit on one line
214
+ " D202" , # No blank lines allowed after function docstring
215
+ " D203" , # Class definitions that are not preceded by a blank line
216
+ " D205" , # 1 blank line required between summary line and description
217
+ " D209" , # Multi-line docstring closing quotes should be on a separate line
218
+ " D212" , # Multi-line docstring summary should start at the first line
219
+ " D213" , # Multi-line docstring summary should start at the second line
220
+ " D400" , # First line should end with a period
221
+ " D401" , # First line of docstring should be in imperative mood
222
+ " D404" , # First word of the docstring should not be "This"
223
+ " D415" , # First line should end with a period, question mark, or exclamation point
224
+ " S101" , # Use of `assert` detected
225
+
226
+ # TODO - need to fix these
227
+ " C901" , # .. is too complex
228
+ " COM812" , # Trailing comma missing
229
+ " E501" , # Line too long
230
+ " EM101" , # Exception must not use a string literal, assign to variable first
231
+ " EM102" , # Exception must not use an f-string literal, assign to variable first
232
+ " FBT001" , # Boolean-typed positional argument in function definition
233
+ " FBT002" , # Boolean default positional argument in function definition
234
+ " FBT003" , # Boolean positional value in function call
235
+ " N802" , # Function name `assertRedirects` should be lowercase
236
+ " N806" , # Variable `UserModel` in function should be lowercase
237
+ " PLC0415" , # `import` should be at the top-level of a file
238
+ " PLR0913" , # Too many arguments in function definition
239
+ " PLR2004" , # Magic value used in comparison, consider replacing .. with a constant variable
240
+ " RET504" , # Unnecessary assignment to .. before `return` statement
241
+ " RET505" , # Unnecessary `elif` after `return` statement
242
+ " S105" , # Possible hardcoded password assigned
243
+ " SIM102" , # Use a single `if` statement instead of nested `if` statements
244
+ " SIM108" , # Use ternary operator .. instead of `if`-`else`-block
245
+ " SIM114" , # Combine `if` branches using logical `or` operator
246
+ " SLF001" , # Private member accessed
247
+ " TC002" , # Move third-party import `django.contrib.messages.Message` into a type-checking block
248
+ " TC003" , # Move standard library import `collections.abc.Sequence` into a type-checking block
249
+ " TRY003" , # Avoid specifying long messages outside the exception class
250
+ ]
251
+ [tool .ruff .lint .per-file-ignores ]
252
+ "tests/*.py" = [
253
+ " ANN" , # Disable all annotations
254
+ " FIX003" , # Line contains XXX, consider resolving the issue
255
+ " DJ008" , # Model does not define .. method
256
+ " N801" , # Class name should use CapWords convention
257
+ " N802" , # Function name should be lowercase
258
+ " S" , # Disable all security checks
259
+ " TD001" , # Invalid TODO tag
260
+ " TD002" , # Missing author in TODO
261
+ " TD003" , # Missing issue link for this TODO
262
+
263
+ # TODO - need to fix these
264
+ " ARG005" , # Unused lambda argument
265
+ " D300" , # Use triple double quotes `"""`
266
+ " D403" , # First word of the docstring should be capitalized
267
+ " ERA001" , # Found commented-out code
268
+ " SIM117" , # Use a single `with` statement with multiple contexts instead of nested `with` statements
269
+ " TC001" , # Move application import .. into a type-checking block
270
+ " TC006" , # Add quotes to type expression in `typing.cast()`
271
+ " PTH108" , # `os.unlink()` should be replaced by `Path.unlink()`
272
+ " PTH110" , # `os.path.exists()` should be replaced by `Path.exists()`
273
+ " RET503" , # Missing explicit `return` at the end of function able to return non-`None` value
274
+ " RSE102" , # Unnecessary parentheses on raised exception
275
+ ]
276
+ "pytest_django_test/*.py" = [
277
+ " ANN" , # Disable all annotations
278
+ " FIX003" , # Line contains XXX, consider resolving the issue
279
+ " DJ008" , # Model does not define .. method
280
+ " N801" , # Class name should use CapWords convention
281
+ " N802" , # Function name should be lowercase
282
+ " S" , # Disable all security checks
283
+ " TD001" , # Invalid TODO tag
284
+ " TD002" , # Missing author in TODO
285
+ " TD003" , # Missing issue link for this TODO
286
+
287
+ # TODO - need to fix these
288
+ " ARG005" , # Unused lambda argument
289
+ " D300" , # Use triple double quotes `"""`
290
+ " D403" , # First word of the docstring should be capitalized
291
+ " ERA001" , # Found commented-out code
292
+ " SIM117" , # Use a single `with` statement with multiple contexts instead of nested `with` statements
293
+ " TC001" , # Move application import .. into a type-checking block
294
+ " TC006" , # Add quotes to type expression in `typing.cast()`
295
+ " PTH108" , # `os.unlink()` should be replaced by `Path.unlink()`
296
+ " PTH110" , # `os.path.exists()` should be replaced by `Path.exists()`
297
+ " RET503" , # Missing explicit `return` at the end of function able to return non-`None` value
298
+ " RSE102" , # Unnecessary parentheses on raised exception
163
299
]
164
300
165
301
[tool .ruff .lint .isort ]
0 commit comments