@@ -226,55 +226,58 @@ docstring-code-format = true
226226
227227[tool .ruff .lint ]
228228select = [
229- " B" , # Likely bugs and design issues
230- " D" , # Documentation style
231- " E" , # Error detected by Pycodestyle
232- " EM" , # Traceback-friendly error messages
233- " F" , # Errors detected by Pyflakes
234- " FBT" , # No positional boolean parameters
235- " I" , # Import sorting
236- " ICN" , # Follow import conventions
237- " PIE" , # Syntax simplifications
238- " PLR0917" , # Ban APIs with too many positional parameters
239- " PT" , # Pytest style
240- " PTH" , # Pathlib instead of os.path
241- " PYI" , # Typing
242- " SIM" , # Simplify control flow
243- " TC" , # Manage type checking blocks
244- " UP" , # Update legacy syntax
245- " TID251" , # Banned imports
246- " W" , # Warning detected by Pycodestyle
229+ " B" , # Likely bugs and design issues
230+ " D" , # Documentation style
231+ " E" , # Error detected by Pycodestyle
232+ " EM" , # Traceback-friendly error messages
233+ " F" , # Errors detected by Pyflakes
234+ " FBT" , # No positional boolean parameters
235+ " I" , # Import sorting
236+ " ICN" , # Follow import conventions
237+ " PIE" , # Syntax simplifications
238+ " PL" , # Pylint
239+ " PT" , # Pytest style
240+ " PTH" , # Pathlib instead of os.path
241+ " PYI" , # Typing
242+ " RUF100" , # Unused noqa
243+ " SIM" , # Simplify control flow
244+ " TC" , # Manage type checking blocks
245+ " UP" , # Update legacy syntax
246+ " TID251" , # Banned imports
247+ " W" , # Warning detected by Pycodestyle
247248]
249+ external = [ " PLR0917" ] # preview lint that we use
248250ignore = [
249- # line too long -> we accept long comment lines; black gets rid of long code lines
250- " E501" ,
251- # module level import not at top of file -> required to circumvent circular imports for Scanpys API
252- " E402" ,
253251 # E266 too many leading '#' for block comment -> Scanpy allows them for comments into sections
254252 " E262" ,
253+ # module level import not at top of file -> required to circumvent circular imports for Scanpys API
254+ " E402" ,
255+ # line too long -> we accept long comment lines; black gets rid of long code lines
256+ " E501" ,
255257 # allow I, O, l as variable names -> I is the identity matrix, i, j, k, l is reasonable indexing notation
256258 " E741" ,
257- # `Literal["..."] | str` is useful for autocompletion
258- " PYI051" ,
259259 # We ban blank lines before docstrings instead of the opposite
260260 " D203" ,
261261 # We want multiline summaries to start on the first line, not the second
262262 " D213" ,
263263 # TODO: replace our current param docs reuse with this and remove it here:
264264 " D417" ,
265+ # Numbers like “2” aren’t that “magic”.
266+ " PLR2004" ,
267+ # `Literal["..."] | str` is useful for autocompletion
268+ " PYI051" ,
265269]
266270[tool .ruff .lint .per-file-ignores ]
267271# Do not assign a lambda expression, use a def
268272"src/scanpy/tools/_rank_genes_groups.py" = [ " E731" ]
269273# No need for docstrings for all benchmarks
270274"benchmarks/**/*.py" = [ " D102" , " D103" ]
271- # No need for docstrings for all test modules and test functions
272- "tests/**/*.py" = [ " D100" , " D101" , " D103" ]
275+ # D*: No need for docstrings for all test modules and test functions
276+ # PLR0913: Test may use many fixtures
277+ "tests/**/*.py" = [ " D100" , " D101" , " D103" , " PLR0913" ]
273278[tool .ruff .lint .isort ]
274279known-first-party = [ " scanpy" , " testing.scanpy" ]
275280required-imports = [ " from __future__ import annotations" ]
276- [tool .ruff .lint .pydocstyle ]
277- convention = " numpy"
278281[tool .ruff .lint .flake8-tidy-imports .banned-api ]
279282"pytest.importorskip".msg = " Use the “@needs” decorator/mark instead"
280283"pandas.api.types.is_categorical_dtype".msg = " Use isinstance(s.dtype, CategoricalDtype) instead"
@@ -290,6 +293,11 @@ convention = "numpy"
290293[tool .ruff .lint .flake8-type-checking ]
291294exempt-modules = [ ]
292295strict = true
296+ [tool .ruff .lint .pydocstyle ]
297+ convention = " numpy"
298+ [tool .ruff .lint .pylint ]
299+ max-args = 10
300+ max-positional-args = 5
293301
294302[tool .towncrier ]
295303name = " scanpy"
0 commit comments