-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
123 lines (110 loc) · 3.86 KB
/
pyproject.toml
File metadata and controls
123 lines (110 loc) · 3.86 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[project]
# Define explicit Python version support
requires-python = ">=3.11"
[tool.ruff]
# Scope to lintScope directories
extend-exclude = [
"runs/",
".venv/",
".pytest_cache/",
"__pycache__/",
"tasks/*/workspace/",
]
# Start with a minimal, high-signal ruleset for brownfield
line-length = 120
[tool.ruff.format]
# Use ruff's formatter with the same line-length and exclusions
line-ending = "auto"
quote-style = "double"
indent-style = "space"
[tool.ruff.lint]
# Expanded ruleset for higher signal bug prevention
select = [
"E", # pycodestyle errors
"F", # pyflakes
"T201", # print() usage detection (flake8-print)
"B", # flake8-bugbear - common bug patterns
"UP", # pyupgrade - Python version upgrade suggestions
"SIM", # flake8-simplify - code simplification
"PERF", # Perflint - performance anti-patterns
]
# Allow brownfield code patterns temporarily
ignore = [
"E402", # Module level import not at top (common in existing code)
"E501", # Line too long (brownfield code has many long lines)
# Bugbear rules that are too noisy for brownfield adoption
"B008", # Do not perform function calls in argument defaults (common pattern)
"B904", # Within an except clause, raise exceptions with `from err` (gradual)
# Simplify rules that require larger refactoring
"SIM108", # Use ternary operator instead of if-else (stylistic preference)
# Perflint rules that are too strict for brownfield
"PERF203", # try-except in loop (sometimes necessary)
]
[tool.ruff.lint.per-file-ignores]
# Allow unused imports and variables in specific files that need gradual cleanup
"harness/expert_questions/run_benchmark.py" = ["F841", "B007"] # B007: unused loop var in stats iteration
"harness/run_harness.py" = [
"F401", "F841",
"UP022", # capture_output (subprocess calls use explicit stdout/stderr for clarity)
"B007", # unused loop variables in tuple unpacking (intentional pattern)
"SIM103", # return condition directly (readability: multi-condition returns)
"SIM105", # contextlib.suppress (explicit try/except preferred for clarity)
"SIM110", # return any() (readability: explicit loop over strategies)
"PERF401", # list comprehension (brownfield: complex dict transformations)
]
"harness/secure_execution.py" = ["UP022"] # capture_output (needs explicit stdout/stderr for preexec_fn)
"server/database.py" = ["F401", "PERF401"] # PERF401: complex dict in list comprehension
"server/monitoring.py" = ["F401"]
"server/qa_database.py" = ["F401", "PERF401"] # PERF401: complex dict in list comprehension
[tool.mypy]
# Brownfield-safe mypy settings for incremental adoption
python_version = "3.11"
exclude = [
"^runs/",
"^\\.venv/",
"^\\.pytest_cache/",
"^__pycache__/",
"^tasks/.*/workspace/",
]
# Start lenient for brownfield - focus on establishing baseline
check_untyped_defs = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
disallow_untyped_calls = false
# Disable warnings to establish baseline
warn_unused_ignores = false
warn_return_any = false
warn_unreachable = false
warn_redundant_casts = false
warn_unused_configs = false
# Allow gradual typing
ignore_missing_imports = true
no_implicit_optional = false
# Allow various errors for brownfield adoption
allow_redefinition = true
allow_untyped_globals = true
implicit_reexport = true
# Disable strict optional for now
strict_optional = false
# Per-file ignores for brownfield adoption
[[tool.mypy.overrides]]
module = [
"server.config",
"server.progress_base",
"server.database",
"server.qa_database",
"server.routes.router",
"server.routes.qa_router",
"harness.config",
"harness.run_harness",
"harness.expert_questions.run_benchmark",
]
disable_error_code = [
"arg-type",
"assignment",
"call-arg",
"misc",
"no-redef",
"valid-type",
"var-annotated",
]