-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathruff.toml
More file actions
142 lines (124 loc) · 3.95 KB
/
Copy pathruff.toml
File metadata and controls
142 lines (124 loc) · 3.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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Ruff configuration
# https://docs.astral.sh/ruff/
# Exclude a variety of commonly ignored directories
exclude = [
".git",
".mypy_cache",
".pytest_cache",
".ruff_cache",
".venv",
"__pycache__",
"build",
"dist",
"*.egg-info",
"docs/templates",
]
# Same as Black
line-length = 100
indent-width = 4
# Assume Python 3.10
target-version = "py310"
[lint]
# Enable specific rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EM", # flake8-errmsg
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"PIE", # flake8-pie
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PL", # pylint
"PERF", # perflint
"RUF", # Ruff-specific rules
]
# Ignore specific rules
ignore = [
"E501", # Line too long (handled by formatter)
"PLR0913", # Too many arguments
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
"PLC0415", # import-outside-top-level (lazy imports are intentional)
"DTZ003", # datetime-utc-now (existing pattern)
"DTZ005", # datetime-now-without-tz (existing pattern)
"PLR0911", # too-many-return-statements (lazy loader pattern)
"PLR0912", # too-many-branches (lazy loader pattern)
"B904", # raise-without-from-inside-except (existing pattern)
"PTH123", # builtin-open (existing pattern)
"ERA001", # commented-out-code
"PERF401", # manual-list-comprehension
"B027", # empty-method-without-abstract-decorator
"EM101", # raw-string-in-exception
"EM102", # f-string-in-exception
"RET505", # superfluous-else-return
"RET506", # superfluous-else-raise
"RET504", # unnecessary-assign
"SIM108", # if-else-block-instead-of-if-exp
"SIM102", # collapsible-if
"SIM105", # suppressible-exception
"PLW2901", # redefined-loop-name
"PLR0915", # too-many-statements
"RUF012", # mutable-class-default
"PERF203", # try-except-in-loop
"E721", # type-comparison (existing pattern)
"B007", # unused-loop-control-variable
"N801", # class-naming (mock classes)
"F402", # import-shadowed-by-loop-var
]
# Allow fix for all enabled rules (when `--fix` is provided)
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[lint.per-file-ignores]
# Tests can use magic values, assertions, etc.
"tests/**/*.py" = [
"PLR2004", # Magic values
"S101", # Use of assert
"S105", # Possible hardcoded password
"S106", # Possible hardcoded password
]
# Intentional imports for availability checking
"src/agentunit/dashboard/server.py" = ["F401"]
"src/agentunit/multimodal/adapters.py" = ["F401"]
"src/agentunit/multiagent/__init__.py" = ["E402"] # Lazy imports after module code
"src/agentunit/pytest/cache.py" = ["TCH003"] # Path used at runtime
"src/agentunit/reporting/results.py" = ["N817"] # ET is conventional for ElementTree
# __init__.py files can have unused imports
"__init__.py" = ["F401"]
[lint.isort]
known-first-party = ["agentunit"]
force-single-line = false
lines-after-imports = 2
[lint.pydocstyle]
convention = "google"
[lint.pylint]
max-args = 10
max-branches = 15
max-returns = 8
max-statements = 60
[format]
# Use double quotes for strings
quote-style = "double"
# Indent with spaces, rather than tabs
indent-style = "space"
# Respect magic trailing commas
skip-magic-trailing-comma = false
# Automatically detect line ending
line-ending = "auto"