-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
53 lines (47 loc) · 2.23 KB
/
Copy pathpyproject.toml
File metadata and controls
53 lines (47 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Python quality-gate config. This repo's source lives under backend/src and its
# tests under backend/tests (tests import as `src.*`), so the tools are pointed at
# backend/ from the repo root via pythonpath / mypy_path / testpaths.
[tool.ruff]
line-length = 100
[tool.ruff.lint]
select = ["E", "W", "F", "I", "B", "S", "C4", "UP", "SIM", "RUF"]
# Gradual gate: these either misfire on this stdlib/FastAPI app or flag long string
# literals that can't be auto-wrapped. Ignored so the gate passes on the existing
# code while the high-signal rules stay on. Tighten as the code is cleaned up.
ignore = [
"E501", # long lines are mostly SQL/URL/prompt string literals ruff-format can't break
"S608", # SQL composed from trusted module-level column constants; values are parameterized
"S310", # urllib endpoints are either configured, or (studio image_url) guarded by
# _check_url_allowed's SSRF host checks before every urlopen call
"S110", # try/except/pass — intentional best-effort paths (e.g. logging must not fail a request)
"S112", # try/except/continue — same intent
"B008", # FastAPI Depends()/File()/Query() in argument defaults is the documented pattern
]
[tool.ruff.lint.per-file-ignores]
# assert is fine in tests
"**/tests/**" = ["S101"]
[tool.mypy]
# Gradual typing. The codebase predates this gate and isn't fully annotated, so
# we don't require annotations everywhere yet (that's 500+ no-untyped-* errors of
# pure noise). Instead we keep the checks that catch real bugs and ratchet modules
# toward strict as they get annotated. Flip `disallow_untyped_defs = true` per
# module below once it's typed.
ignore_missing_imports = true
# Resolve `import src.*` (source lives in backend/) from the repo root.
mypy_path = "backend"
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
check_untyped_defs = true
warn_return_any = true
no_implicit_optional = true
strict_equality = true
[tool.pytest.ini_options]
addopts = "--cov=src --cov-report=term-missing --cov-fail-under=80"
testpaths = ["backend/tests"]
# Put backend/ on sys.path so `import src.*` resolves when run from the repo root.
pythonpath = ["backend"]
asyncio_mode = "auto"
[tool.coverage.run]
branch = true
source = ["src"]