@@ -13,19 +13,18 @@ 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
2928]
3029
3130select = [
@@ -46,12 +45,14 @@ select = [
4645 " PTH" ,# flake8-use-pathlib (use pathlib instead of os.path where possible)
4746 " PL" , # Pylint rules ported to Ruff (PLC, PLE, PLR, PLW)
4847 " PIE" ,# flake8-pie (misc code improvements, e.g., no-unnecessary-pass)
49- " RUF" ,# Ruff-specific rules (e.g., RUF001-003 ambiguous unicode)
48+ " RUF" ,# Ruff-specific rules (e.g., RUF001-003 ambiguous unicode, RUF013 implicit optional )
5049 " RET" ,# flake8-return (consistency in return statements)
5150 " SLF" ,# flake8-self (check for private member access via `self`)
5251 " TID" ,# flake8-tidy-imports (relative imports, banned imports - configure if needed)
5352 " YTT" ,# flake8-boolean-trap (checks for boolean positional arguments, truthiness tests - Google Style §3.10)
5453 " TD" , # flake8-todos (check TODO format - Google Style §3.7)
54+ " TCH" ,# flake8-type-checking (helps manage TYPE_CHECKING blocks and imports)
55+ " PYI" ,# flake8-pyi (best practices for .pyi stub files, some rules are useful for .py too)
5556]
5657
5758exclude = [
@@ -76,7 +77,6 @@ exclude = [
7677 " node_modules" ,
7778 " venv" ,
7879 " */migrations/*" ,
79- " test_*" ,
8080]
8181
8282[lint .isort ]
@@ -115,8 +115,22 @@ inline-quotes = "single"
115115
116116[lint .per-file-ignores ]
117117"__init__.py" = [" F401" , " D" , " ANN" ] # Ignore unused imports in __init__.py
118- "*_test.py" = [" D" , " ANN" ] # Ignore docstring and annotation issues in test files
119- "test_*.py" = [" D" , " ANN" ] # Ignore docstring and annotation issues in test files
118+ "*_test.py" = [
119+ " D" , # All pydocstyle rules
120+ " ANN001" , # Missing type annotation for function argument
121+ " ANN201" , # Missing return type annotation for public function
122+ " ANN204" , # Missing return type annotation for special method
123+ " RUF013" , # Implicit optional type in test function signatures
124+ " S101" , # Use of `assert` detected (expected in tests)
125+ ]
126+ "test_*.py" = [
127+ " D" ,
128+ " ANN001" ,
129+ " ANN201" ,
130+ " ANN204" ,
131+ " RUF013" ,
132+ " S101" ,
133+ ]
120134"types.py" = [" D" , " E501" , " N815" ] # Ignore docstring and annotation issues in types.py
121135
122136[format ]
0 commit comments