@@ -13,19 +13,22 @@ target-version = "py310" # Minimum Python version
1313
1414[lint ]
1515ignore = [
16- " COM812" ,
17- " FBT001" ,
18- " FBT002" ,
19- " D203" ,
20- " D213" ,
21- " D100" , # Ignore Missing docstring in public module (often desired at top level __init__.py)
22- " D104" , # Ignore Missing docstring in public package (often desired at top level __init__.py)
23- " D107" , # Ignore Missing docstring in __init__ (use class docstring)
24- " TD002" , # Ignore Missing author in TODOs (often not required)
25- " TD003" , # Ignore Missing issue link in TODOs (often not required/available)
26- " T201" , # Ignore print presence
16+ " COM812" , # Trailing comma missing.
17+ " FBT001" , # Boolean positional arg in function definition
18+ " FBT002" , # Boolean default value in function definition
19+ " D203" , # 1 blank line required before class docstring (Google: 0)
20+ " D213" , # Multi-line docstring summary should start at the second line (Google: first line)
21+ " D100" , # Ignore Missing docstring in public module (often desired at top level __init__.py)
22+ " D104" , # Ignore Missing docstring in public package (often desired at top level __init__.py)
23+ " D107" , # Ignore Missing docstring in __init__ (use class docstring)
24+ " TD002" , # Ignore Missing author in TODOs (often not required)
25+ " TD003" , # Ignore Missing issue link in TODOs (often not required/available)
26+ " T201" , # Ignore print presence
2727 " RUF012" , # Ignore Mutable class attributes should be annotated with `typing.ClassVar`
28- " RUF013" , # Ignore implicit optional
28+ " E501" , # Ignore line length (handled by Ruff's dynamic line length)
29+ " ANN002" ,
30+ " ANN003" ,
31+ " ANN401" ,
2932]
3033
3134select = [
@@ -46,12 +49,14 @@ select = [
4649 " PTH" ,# flake8-use-pathlib (use pathlib instead of os.path where possible)
4750 " PL" , # Pylint rules ported to Ruff (PLC, PLE, PLR, PLW)
4851 " PIE" ,# flake8-pie (misc code improvements, e.g., no-unnecessary-pass)
49- " RUF" ,# Ruff-specific rules (e.g., RUF001-003 ambiguous unicode)
52+ " RUF" ,# Ruff-specific rules (e.g., RUF001-003 ambiguous unicode, RUF013 implicit optional )
5053 " RET" ,# flake8-return (consistency in return statements)
5154 " SLF" ,# flake8-self (check for private member access via `self`)
5255 " TID" ,# flake8-tidy-imports (relative imports, banned imports - configure if needed)
5356 " YTT" ,# flake8-boolean-trap (checks for boolean positional arguments, truthiness tests - Google Style §3.10)
5457 " TD" , # flake8-todos (check TODO format - Google Style §3.7)
58+ " TCH" ,# flake8-type-checking (helps manage TYPE_CHECKING blocks and imports)
59+ " PYI" ,# flake8-pyi (best practices for .pyi stub files, some rules are useful for .py too)
5560]
5661
5762exclude = [
@@ -76,7 +81,7 @@ exclude = [
7681 " node_modules" ,
7782 " venv" ,
7883 " */migrations/*" ,
79- " test_* " ,
84+ " noxfile.py " ,
8085]
8186
8287[lint .isort ]
@@ -94,6 +99,8 @@ lines-between-types = 1
9499
95100[lint .pydocstyle ]
96101convention = " google"
102+ ignore-decorators = [" typing.overload" , " abc.abstractmethod" ]
103+ ignore-var-parameters = true
97104
98105[lint .flake8-annotations ]
99106mypy-init-return = true
@@ -113,11 +120,26 @@ inline-quotes = "single"
113120
114121[lint .per-file-ignores ]
115122"__init__.py" = [" F401" , " D" , " ANN" ] # Ignore unused imports in __init__.py
116- "*_test.py" = [" D" , " ANN" ] # Ignore docstring and annotation issues in test files
117- "test_*.py" = [" D" , " ANN" ] # Ignore docstring and annotation issues in test files
123+ "*_test.py" = [
124+ " D" , # All pydocstyle rules
125+ " ANN" , # Missing type annotation for function argument
126+ " RUF013" , # Implicit optional type in test function signatures
127+ " S101" , # Use of `assert` detected (expected in tests)
128+ " PLR2004" ,
129+ " SLF001" ,
130+ ]
131+ "test_*.py" = [
132+ " D" ,
133+ " ANN" ,
134+ " RUF013" ,
135+ " S101" ,
136+ " PLR2004" ,
137+ " SLF001" ,
138+ ]
118139"types.py" = [" D" , " E501" , " N815" ] # Ignore docstring and annotation issues in types.py
119140
120141[format ]
142+ exclude = [" types.py" ]
121143docstring-code-format = true
122144docstring-code-line-length = " dynamic" # Or set to 80
123145quote-style = " single"
0 commit comments