forked from yandex/gixy
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathruff.toml
More file actions
47 lines (43 loc) · 1.74 KB
/
ruff.toml
File metadata and controls
47 lines (43 loc) · 1.74 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
# Ruff configuration for gixy
# Focuses on catching real bugs, not legacy style issues
[lint]
# Enable sensible defaults
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
]
# Ignore rules that would require major refactoring of legacy code
ignore = [
"E501", # line-too-long (223 occurrences in legacy code)
"E711", # none-comparison (== None vs is None)
"F403", # undefined-local-with-import-star (sre_parse uses star imports)
"F405", # undefined-local-with-import-star-usage
"UP008", # super-call-with-parameters (legacy Python 2 style)
"UP021", # universal-newlines -> text (text requires Python 3.7+, we support 3.6)
"UP030", # format-literals (legacy .format() style)
"UP031", # printf-string-formatting (legacy % style)
"SIM102", # collapsible-if (sometimes clearer as-is)
"SIM105", # suppressible-exception (contextlib.suppress not always clearer)
"SIM103", # needless-bool (sometimes clearer as-is in complex conditions)
"SIM108", # if-else-block-instead-of-if-exp (ternary)
"SIM110", # reimplemented-builtin (any/all)
"E721", # type-comparison (sometimes intentional)
"E722", # bare-except (legacy code)
"B007", # unused-loop-control-variable (false positives)
"B904", # raise-without-from-inside-except
]
# Exclude generated/vendored/legacy code
exclude = [
"gixy/core/sre_parse/*", # Vendored Python sre_parse
"site/*",
".git",
"setup.py", # Legacy Python 2 compat hacks
]
[lint.per-file-ignores]
# Tests often have stylistic shortcuts
"tests/*" = ["B", "SIM", "RUF012"]