-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
69 lines (60 loc) · 1.95 KB
/
Copy pathruff.toml
File metadata and controls
69 lines (60 loc) · 1.95 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Ruff configuration (replaces flake8 + isort)
# https://docs.astral.sh/ruff/configuration/
line-length = 100
indent-width = 4
target-version = "py311"
[lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"S", # flake8-bandit (security subset)
"T20", # flake8-print
"SIM", # flake8-simplify
"ANN", # flake8-annotations
]
ignore = [
# --- Testing ---
"S101", # assert allowed in pytest
"S105", # hardcoded password allowed in test fixtures
"S106",
# --- Annotations ---
# ANN101/ANN102 removed in ruff (self/cls hints not needed)
"ANN204", # __init__ return type not required
"ANN201", # FastAPI route return types are inferred by framework
"ANN202", # private helper return types
"ANN001", # function argument annotations (too noisy for existing code)
"ANN002", # *args annotation
"ANN003", # **kwargs annotation
# --- FastAPI conventions ---
"B008", # Depends() in argument defaults is FastAPI's design pattern
# --- Style (handled by formatter) ---
"E501", # line-too-long (covered by line-length setting)
"T201", # print() allowed (production uses structlog)
]
# Per-file rule overrides
[lint.per-file-ignores]
"tests/**/*.py" = [
"S", # security rules relaxed in tests
"ANN", # type hints not required in tests
"SIM117", # nested with patch()+client.stream() is intentional test pattern
]
"migrations/**/*.py" = [
"E501",
"ANN",
]
# S608: multi-line f-string SQL cannot use # noqa inline.
# exclude_clause is a 2-value hardcoded constant (confirmed safe by bandit -ii).
"app/services/embedding_service.py" = ["S608"]
[lint.isort]
known-first-party = ["app"]
force-single-line = false
combine-as-imports = true
[format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"