-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.ruff.toml
More file actions
182 lines (140 loc) · 5.4 KB
/
.ruff.toml
File metadata and controls
182 lines (140 loc) · 5.4 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
fix = true
target-version = "py39"
[lint]
# https://beta.ruff.rs/docs/rules/
select = [
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
# https://github.com/gforcada/flake8-builtins
"A",
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
# https://github.com/sco1/flake8-annotations
# "ANN",
# https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
# https://github.com/nhoad/flake8-unused-arguments
# TODO: "ARG",
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
# https://github.com/PyCQA/flake8-bugbear
"B",
# https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
# https://github.com/elijahandrews/flake8-blind-except
"BLE",
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
# https://github.com/PyCQA/flake8-commas/
# About this warning:
# > The following rule may cause conflicts when used with the formatter: `COM812`
# Check https://github.com/astral-sh/ruff/issues/9216
"COM",
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
# https://github.com/adamchainz/flake8-comprehensions
"C4",
# rules from mccabe
"C90",
# https://docs.astral.sh/ruff/rules/#flake8-django-dj
# https://github.com/rocioar/flake8-django
"DJ",
# https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
# https://github.com/pjknkda/flake8-datetimez
# TODO: "DTZ",
# https://docs.astral.sh/ruff/rules/#error-e
# https://github.com/PyCQA/pycodestyle
"E",
# https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
# https://github.com/henryiii/flake8-errmsg
"EM",
# https://docs.astral.sh/ruff/rules/#flake8-executable-exe
# https://github.com/xuhdev/flake8-executable
"EXE",
# https://docs.astral.sh/ruff/rules/#pyflakes-f
# https://github.com/PyCQA/pyflakes
"F",
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
# https://github.com/pwoolvett/flake8_boolean_trap
# TODO: "FBT",
# https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
# https://github.com/globality-corp/flake8-logging-format
"G",
# https://docs.astral.sh/ruff/rules/#isort-i
# https://pycqa.github.io/isort/
"I",
# https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
# https://github.com/joaopalmeiro/flake8-import-conventions
"ICN",
# https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
# https://github.com/flake8-implicit-str-concat/flake8-implicit-str-concat
"ISC",
# https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
# https://github.com/adamchainz/flake8-no-pep420
"INP",
# https://docs.astral.sh/ruff/rules/#flake8-gettext-int
# https://github.com/cielavenir/flake8_gettext
"INT",
# https://docs.astral.sh/ruff/rules/#flake8-pie-pie
# https://github.com/sbdchd/flake8-pie
# TODO: "PIE",
# https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
# https://github.com/m-burst/flake8-pytest-style
# TODO: "PT",
# https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
# https://github.com/PyCQA/flake8-pyi
"PYI",
# https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
# https://gitlab.com/RoPP/flake8-use-pathlib
"PTH",
# https://docs.astral.sh/ruff/rules/#flake8-return-ret
# https://github.com/afonasev/flake8-return
"RET",
# https://docs.astral.sh/ruff/rules/#flake8-raise-rse
# https://github.com/jdufresne/flake8-raise
"RSE",
# https://docs.astral.sh/ruff/rules/unused-noqa/
"RUF100",
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
# https://github.com/tylerwince/flake8-bandit
"S",
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
# https://github.com/MartinThoma/flake8-simplify
"SIM",
# https://docs.astral.sh/ruff/rules/#flake8-self-slf
# https://github.com/korijn/flake8-self
# TODO: "SLF",
# rules from flake8-type-checking
# TODO:
# Replace with the new rules
# https://github.com/astral-sh/ruff/issues/9573
"TCH",
# https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
# https://github.com/adamchainz/flake8-tidy-imports
"TID",
# https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
# https://github.com/jbkahn/flake8-debugger
"T10",
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
# https://github.com/jbkahn/flake8-print
"T20",
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
# https://github.com/asottile/pyupgrade
"UP",
# https://docs.astral.sh/ruff/rules/#warning-w
# https://github.com/PyCQA/pycodestyle
"W",
# https://docs.astral.sh/ruff/rules/#flake8-2020-ytt
# https://github.com/asottile-archive/flake8-2020
"YTT",
]
ignore = [
"COM812",
"B024",
"EM101", # ignore raw-string-in-exception
"EM102", # ignore f-string-in-exception (EM102)
"S311", # ignore Standard pseudo-random generators because they are not used for cryptographic purposes
"S603", # ignore shell subprocess malicious attack because all commmand made here are not risk
"INP001", # ignore package because in management folder not need to declare as a package, it's a django cli
]
[lint.flake8-tidy-imports]
## Disallow all relative imports.
ban-relative-imports = "all"
[lint.per-file-ignores]
# ignore assert statements in tests
"tests/*.py" = ["S101"]
# ignore SECRET_KEY in settings files in tests
"tests/settings/*.py" = ["S105"]