-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathruff.toml
More file actions
72 lines (63 loc) · 2.79 KB
/
Copy pathruff.toml
File metadata and controls
72 lines (63 loc) · 2.79 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
70
71
72
line-length = 88
indent-width = 4
target-version = "py312"
exclude = [".git", "__pycache__", "build", "dist", "notebooks"]
[format]
quote-style = "double"
indent-style = "space"
[lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"N", # pep8-naming
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"S", # bandit (security)
"PLC", # pylint-convention
"PLE", # pylint-error
"PLR", # pylint-refactor
"PLW", # pylint-warning
]
ignore = [
# --- Type annotations: too invasive to add retroactively to entire codebase ---
"ANN001", # Missing type annotation for function argument
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"ANN201", # Missing return type annotation for public function
"ANN202", # Missing return type annotation for private function
"ANN204", # Missing return type annotation for __init__ / special methods
"ANN205", # Missing return type annotation for static method
"ANN206", # Missing return type annotation for classmethod
"ANN401", # Use of typing.Any — sometimes necessary for generic utilities
# --- Line length: existing docstrings/comments exceed 88 chars ---
"E501", # Line too long (formatting long prose is risky)
# --- Complexity: these would require significant API changes ---
"PLR0913", # Too many arguments (several public methods have many params)
"PLR0912", # Too many branches
"PLR0915", # Too many statements
# --- Magic values: too noisy in numeric evaluation / threshold code ---
"PLR2004", # Magic value used in comparison
# --- Security: intentional patterns ---
"S311", # Pseudo-random not suitable for crypto — used for fake data generation
# --- Import style: valid pattern in data_generator __init__ ---
"PLC0415", # Import outside top-level
# --- zip strict: acceptable in production evaluation code ---
"B905", # zip() without explicit strict= parameter
# --- Formatter conflict: COM812 may produce conflicting results with ruff format ---
"COM812", # missing trailing comma — disabled to avoid formatter conflicts
]
[lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # Use of assert — expected and required in pytest tests
"S105", # Hardcoded passwords — fake data in test fixtures
"S106", # Hardcoded passwords as arguments — fake data in test fixtures
"ANN", # No type annotations needed in test helpers
"N", # Naming conventions differ in test fixtures/parametrize
"PLR", # Magic values / complexity OK in tests
]