-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathruff.toml
131 lines (123 loc) · 3.44 KB
/
ruff.toml
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
# Always generate Python 3.11-compatible code.
target-version = "py311"
# Same as Black.
line-length = 120
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
# Not for the dojo specific stuff
"dojo/db_migrations"
]
[lint]
select = [
"F",
"E",
"W",
"C90",
"I",
"N803", "N804", "N811", "N812", "N813", "N814", "N817", "N818", "N999",
"D2", "D3", "D402", "D403", "D405", "D406", "D407", "D408", "D409", "D410", "D411", "D412", "D413", "D414", "D416",
"UP",
"YTT",
"ASYNC",
"S1", "S2", "S302", "S303", "S304", "S305", "S306", "S307", "S31", "S321", "S323", "S401", "S402", "S406", "S407", "S408", "S409", "S41", "S5", "S601", "S602", "S604", "S605", "S606", "S607", "S609", "S61", "S7",
"FBT",
"A",
"COM",
"C4",
"T10",
"DJ003", "DJ01",
"EM",
"EXE",
"FA",
"DTZ003", "DTZ004", "DTZ012", "DTZ901",
"ISC",
"ICN",
"LOG",
"G001", "G002", "G01", "G1", "G2",
"INP",
"PIE",
"T20",
"Q",
"RSE",
"RET",
"SLOT",
"SIM",
"TID",
"TC",
"INT",
"ARG003", "ARG004", "ARG005",
"PTH",
"TD001", "TD004", "TD005", "TD007",
"FIX",
"PD",
"PGH",
"PLC01", "PLC0205", "PLC0208", "PLC0414", "PLC18", "PLC24", "PLC28", "PLC3",
"PLE",
"PLR01", "PLR02", "PLR04", "PLR0915", "PLR1716", "PLR172", "PLR1733", "PLR1736", "PLR5", "PLR6104", "PLR6201",
"PLW01", "PLW02", "PLW04", "PLW0602", "PLW0604", "PLW07", "PLW1", "PLW2", "PLW3",
"TRY003", "TRY004", "TRY2", "TRY300", "TRY401",
"PT001", "PT002", "PT003", "PT006", "PT007", "PT008", "PT01", "PT020", "PT021", "PT022", "PT023", "PT024", "PT025", "PT026", "PT028", "PT029", "PT03",
"FLY",
"NPY",
"PYI00", "PYI01", "PYI020", "PYI021", "PYI025", "PYI026", "PYI029", "PYI03", "PYI04", "PYI05", "PYI06",
"FAST",
"AIR",
"FURB",
"DOC202", "DOC403", "DOC502",
"RUF",
"B00", "B010", "B011", "B012", "B013", "B014", "B015", "B016", "B017", "B018", "B019", "B020", "B021", "B022", "B023", "B025", "B028", "B029", "B03", "B901", "B903", "B905", "B911",
"PERF1", "PERF2",
]
ignore = [
"E501",
"E722",
"SIM102",
"SIM115",
"RUF012",
"RUF015",
"D205",
"FIX002", # TODOs need some love but we will probably not get of them
"D211", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible.
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible.
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
preview = true
[lint.per-file-ignores]
"unittests/**" = [
"S105", # hardcoded passwords in tests are fine
"S108", # tmp paths mentioned in tests are fine
]
"unittests/tools/**" = [
"PTH123", # Fix is needed in unittests/tools as well but there are too many problematic files, let's do it per partes
]
".github/pr-reminder.py" = [
"INP001", # https://docs.astral.sh/ruff/rules/implicit-namespace-package/
]
[lint.flake8-boolean-trap]
extend-allowed-calls = ["dojo.utils.get_system_setting"]
[lint.pylint]
max-statements = 234
[lint.mccabe]
max-complexity = 70 # value is far from perfect (recommended default is 10). But we will try to decrease it over the time.