Skip to content

Commit 15e6002

Browse files
committed
feat: complexity checks
1 parent 152c570 commit 15e6002

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

pyproject.toml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,22 @@ target-version = "py313"
4343
select = ["ALL"]
4444
ignore = [
4545
"ANN204", # Missing return type for __init__
46-
"C901", # Too complex
4746
"COM812", # Missing trailing comma (conflicts with formatter)
48-
"D100", "D101", "D102", "D103", "D104", "D105", "D107", # Missing docstrings
47+
"D100", "D101", "D102", "D103", "D104", "D105", "D107", # Docstrings optional
4948
"D401", # First line imperative mood
5049
"E501", # Line too long (handled by formatter)
51-
"ISC001", # Single line implicit string concatenation (conflicts with formatter)
52-
"RET503", # Missing explicit return
53-
"S104", # Possible binding to all interfaces
54-
"S608", # SQL injection (too many false positives)
50+
"ISC001", # Conflicts with formatter
51+
"PLR0913", # Too many arguments (sometimes necessary)
52+
"S104", # Binding to all interfaces
53+
"S608", # SQL injection (false positives with ORMs)
5554
"W291", # Trailing whitespace
5655
]
5756
fixable = ["ALL"]
5857
pydocstyle = { convention = "google" }
5958

59+
[tool.ruff.lint.mccabe]
60+
max-complexity = 15
61+
6062
[tool.ruff.lint.per-file-ignores]
6163
"**/wip*.py" = ["ALL"]
6264
"**/tests/*" = ["D", "ANN", "S", "ERA", "INP001"]
@@ -88,19 +90,19 @@ docstring-code-line-length = 125
8890
include = ["src"]
8991
exclude = ["**/node_modules", "**/__pycache__", ".venv", ".git", "dist", "build", "_*", "wip*", "**/tests", "**/gen", "**/program/*", "**/*.ipynb", "**/wip*.py"]
9092
defineConstant = { DEBUG = true }
91-
typeCheckingMode = "standard"
93+
typeCheckingMode = "strict"
9294
pythonVersion = "3.13"
9395
pythonPlatform = "All"
96+
# Relaxations for strict mode
97+
reportUnknownMemberType = "warning" # Too noisy for dynamic frameworks
98+
reportUnknownArgumentType = false # Too noisy for dynamic frameworks
99+
reportUnusedCallResult = false # Side-effect functions
100+
# Additional checks (explicit)
94101
reportMissingImports = "error"
95-
reportMissingTypeStubs = false
96-
reportMissingModuleSource = false
97102
reportUnknownParameterType = "warning"
98-
reportUnknownArgumentType = false
99-
reportUnknownMemberType = false
103+
reportUnknownArgumentType = "warning"
100104
reportMissingParameterType = "warning"
101105
reportUnnecessaryTypeIgnoreComment = "warning"
102106
reportUnnecessaryIsInstance = "warning"
103-
reportImportCycles = "warning"
104-
reportUnusedImport = "warning"
107+
reportImportCycles = "error"
105108
reportUnusedVariable = "warning"
106-
reportDuplicateImport = "warning"

0 commit comments

Comments
 (0)