Add ruff linter/formatter for Python
- Add ruff as dev dependency - Configure ruff in pyproject.toml with strict 88-char line limit - Ignore B008 (FastAPI Depends pattern is standard) - Allow longer lines in tests for readability - Fix all lint issues in source files - Add Makefile targets: lint-backend, format-backend, fix-backend
This commit is contained in:
parent
69bc8413e0
commit
6c218130e9
31 changed files with 1234 additions and 876 deletions
|
|
@ -20,6 +20,7 @@ dev = [
|
|||
"httpx>=0.28.1",
|
||||
"aiosqlite>=0.20.0",
|
||||
"mypy>=1.13.0",
|
||||
"ruff>=0.14.10",
|
||||
]
|
||||
|
||||
[tool.mypy]
|
||||
|
|
@ -30,3 +31,27 @@ check_untyped_defs = true
|
|||
ignore_missing_imports = true
|
||||
exclude = ["tests/"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
target-version = "py311"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
"B", # flake8-bugbear
|
||||
"UP", # pyupgrade
|
||||
"SIM", # flake8-simplify
|
||||
"RUF", # ruff-specific rules
|
||||
]
|
||||
ignore = [
|
||||
"B008", # function-call-in-default-argument (standard FastAPI pattern with Depends)
|
||||
]
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = "double"
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/*" = ["E501"] # Allow longer lines in tests for readability
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue