forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruff.toml
123 lines (115 loc) · 2.38 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
# 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",
"D2", "D3", "D403", "D411", "D413",
"UP",
"YTT",
"ASYNC",
"S2", "S5", "S7", "S101", "S104", "S105", "S106", "S108", "S311", "S112", "S113",
"FBT001", "FBT003",
"A003", "A004", "A005", "A006",
"COM",
"C4",
"T10",
"DJ003", "DJ012", "DJ013",
"EM",
"EXE",
"ISC001",
"ICN",
"LOG",
"G001", "G002", "G1", "G2",
"INP",
"RET",
"PIE",
"T20",
"Q",
"RSE",
"SLOT",
"SIM",
"TID",
"TCH",
"INT",
"ARG003", "ARG004", "ARG005",
"PTH2", "PTH101", "PTH102", "PTH103", "PTH104", "PTH105", "PTH106", "PTH107", "PTH108", "PTH109", "PTH110", "PTH111", "PTH112", "PTH113", "PTH114", "PTH115", "PTH116", "PTH117", "PTH119", "PTH120", "PTH121", "PTH122", "PTH124",
"TD001", "TD004", "TD005",
"PD",
"PGH",
"PLE",
"PLR0915",
"PLW1", "PLW2", "PLW3",
"FIX001",
"FIX003",
"TRY003",
"TRY004",
"TRY2",
"FLY",
"NPY",
"FAST",
"AIR",
"FURB",
"RUF",
]
ignore = [
"E501",
"E722",
"SIM102",
"SIM113",
"SIM115",
"SIM116",
"SIM117",
"RUF010",
"RUF012",
"RUF015",
"RUF027",
"D205",
"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
]
[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.