-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
305 lines (292 loc) · 8.99 KB
/
setup.cfg
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# All configuration for plugins and other utils is defined here.
# Read more about `setup.cfg`:
# https://docs.python.org/3/distutils/configfile.html
[flake8]
format = wemake
show-source = True
statistics = True
doctests = True
enable-extensions = G
# Flake plugins:
max-line-length = 80
max-complexity = 6
radon-max-cc = 10
radon-show-closures = True
radon-no-assert = True
inline-quotes = double
nested-classes-whitelist = Meta, Media
# Excluding some directories:
exclude = .git,
__pycache__,
.venv,
.eggs,
*.egg
ignore =
D100 D104 D106 D401 X100 W503 WPS306 WPS317 WPS121 WPS323 D105 WPS115 WPS226 WPS348 E203
;5 B001 Do not use bare `except:`, it also catches unexpected events like memory errors, interrupts, system exit, and so on. Prefer `except Exception:`. If you're sure what you're doing, be explicit and write `except BaseException:`.
B001
;1 B006 Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.
B006
;1 B007 Loop control variable 'model_admin' not used within the loop body. If this is intended, start the name with an underscore.
B007
;2 B011 Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().
B011
;5 C103 Coding magic comment present
C103
;1 C405 Unnecessary list literal - rewrite as a set literal.
C405
;1 C409 Unnecessary list passed to tuple() - rewrite as a tuple literal.
C409
;83 C812 missing trailing comma
C812
;3 C815 missing trailing comma in Python 3.5+
C815
;4 C819 trailing comma prohibited
C819
;8 C901 'LinkList.init_with_context' is too complex (10)
C901
;23 CCE001 AutocompleteFilter.rel_model should be after AutocompleteFilter.Media
CCE001
;62 D101 Missing docstring in public class
D101
;68 D102 Missing docstring in public method
D102
;13 D103 Missing docstring in public function
D103
;17 D107 Missing docstring in __init__
D107
;34 D200 One-line docstring should fit on one line with quotes
D200
;2 D202 No blank lines allowed after function docstring
D202
;46 D205 1 blank line required between summary line and description
D205
;1 D209 Multi-line docstring closing quotes should be on a separate line
D209
;3 D210 No whitespaces allowed surrounding docstring text
D210
;34 D400 First line should end with a period
D400
;2 E231 missing whitespace after ','
E231
;1 E401 multiple imports on one line
E401
;4 E402 module level import not at top of file
E402
;30 E501 line too long (83 > 80 characters)
E501
;5 E722 do not use bare 'except'
E722
;43 E800: Found commented out code
E800
;10 F401 'jnt_admin_tools' imported but unused
F401
;3 F403 'from jnt_admin_tools.dashboard.dashboards import *' used; unable to detect undefined names
F403
;1 F821 undefined name 'render_to_response'
821
;70 I001 isort found an import in the wrong position
I001
;29 I003 isort expected 1 blank line in imports, found 0
I003
;4 I004 isort found an unexpected blank line in imports
I004
;2 N802 function name 'assertDeprecated' should be lowercase
N802
;20 PT009 use a regular assert instead of unittest-style 'assertEqual'
PT009
;2 PT015 assertion always fails, replace with pytest.fail()
PT015
;116 Q000 Remove bad quotes
Q000
;2 R701 'LinkList' is too complex (11)
R701
;25 RST304 Unknown interpreted text role "class".
RST304
;6 S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
S101
;1 S105 Possible hardcoded password: 'django-admin-tools'
S105
;1 S106 Possible hardcoded password: '123'
S106
;4 S110 Try, Except, Pass detected.
S110
;2 S306 Use of insecure and deprecated function (mktemp).
S306
;3 S308 Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
308
;2 S703 Potential XSS on mark_safe function.
S703
;3 WPS100 Found wrong module name
WPS100
;11 WPS102 Found incorrect module name pattern
WPS102
;49 WPS110 Found wrong variable name: obj
WPS110
;21 WPS111 Found too short name: x < 2
WPS111
;6 WPS114 Found underscored name pattern: 0002_auto_20190610_1412
WPS114
;3 WPS117 Found name reserved for first argument: cls
WPS117
;1 WPS122 Found all unused variables definition: _copy_func
WPS122
;14 WPS125 Found builtin shadowing: copyright
WPS125
;1 WPS202 Found too many module members: 10 > 7
WPS202
;1 WPS204 Found overused expression: link['attrs']; used 7 > 4
WPS204
;12 WPS210 Found too many local variables: 7 > 5
WPS210
;2 WPS211 Found too many arguments: 6 > 5
WPS211
;1 WPS213 Found too many expressions: 13 > 9
WPS213
;2 WPS214 Found too many methods: 11 > 7
WPS214
;2 WPS219 Found too deep access level: 5 > 4
WPS219
;4 WPS220 Found too deep nesting: 24 > 20
WPS220
;4 WPS221 Found line with high Jones Complexity: 15 > 14
WPS221
;6 WPS229 Found too long ``try`` body length: 2 > 1
WPS229
;5 WPS231 Found too high function cognitive complexity: 19 > 12
WPS231
;2 WPS232 Found too high module cognitive complexity: 10.0 > 8
WPS232
;9 WPS300 Found local folder import
WPS300
;7 WPS301 Found dotted raw import: django.db.models.deletion
WPS301
;11 WPS305 Found `f` string
WPS305
;1 WPS322 Found incorrect multi-line string
WPS322
;11 WPS326 Found implicit string concatenation
WPS326
;1 WPS331 Found variables that are only used for `return`: g
WPS331
;7 WPS336 Found explicit string concat
WPS336
;2 WPS337 Found multiline conditions
WPS337
;6 WPS338 Found incorrect order of methods in a class
WPS338
;4 WPS347 Found vague import that may cause confusion: *
WPS347
;2 WPS349 Found redundant subscript slice
WPS349
;1 WPS350 Found usable augmented assign pattern
WPS350
;1 WPS352 Found multiline loop
WPS352
;1 WPS404 Found complex default value
WPS404
;3 WPS407 Found mutable module constant
WPS407
;2 WPS410 Found wrong metadata variable: __author__
WPS410
;2 WPS411 Found empty module
WPS411
;8 WPS412 Found `__init__.py` module with logic
WPS412
;29 WPS420 Found wrong keyword: pass
WPS420
;7 WPS421 Found wrong function call: hasattr
WPS421
;2 WPS422 Found future import: unicode_literals
WPS422
;3 WPS426 Found `lambda` in loop's body
WPS426
;9 WPS430 Found nested function: _get_media
WPS430
;1 WPS431 Found nested class: ImportDeprecationMixin
WPS431
;12 WPS432 Found magic number: 255
WPS432
;33 WPS433 Found nested import
WPS433
;33 WPS437 Found protected attribute usage: _meta
WPS437
;11 WPS440 Found block variables overlap: *
WPS440
;3 WPS441 Found control variable used after block: item
WPS441
;2 WPS444 Found wrong keyword condition
WPS444
;1 WPS503 Found useless returning `else` statement
WPS503
;2 WPS505 Found nested `try` block
WPS505
;1 WPS510 Found `in` used with a non-set container
WPS510
;2 WPS515 Found `open()` used without a context manager
WPS515
;6 WPS528 Found implicit `.items()` usage
WPS528
;2 WPS529 Found implicit `.get()` dict usage
WPS529
;19 WPS601 Found shadowed class attribute: children
WPS601
;15 WPS604 Found incorrect node inside `class` body
WPS604
;14 WPS606 Found incorrect base class
WPS606
;13 WPS608 Found incorrect `super()` call: remove arguments
WPS608
;14 WPS609 Found direct magic attribute usage: __path__
WPS609
;3 S308 Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
S308
; WPS324 Found inconsistent `return` statement
WPS324
; WPS215 Too many base classes: 5 > 3
WPS215
per-file-ignores =
test_proj/*/migrations/*.py: WPS458
[isort]
# isort configuration:
# https://github.com/timothycrosley/isort/wiki/isort-Settings
include_trailing_comma = true
# See https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output = 3
# Should be: 80 - 1
line_length = 79
skip = __init__.py, migrations
force_grid_wrap = 0
use_parentheses = True
src_paths = src,tests
[darglint]
# darglint configuration:
# https://github.com/terrencepreilly/darglint
strictness = long
[mypy]
python_version = 3.8
allow_redefinition = False
check_untyped_defs = True
disallow_any_explicit = True
disallow_any_generics = True
disallow_untyped_calls = True
ignore_errors = False
ignore_missing_imports = True
implicit_reexport = False
strict_equality = True
no_implicit_optional = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unreachable = True
warn_no_return = True
[mypy-server.*.migrations.*]
ignore_errors = True
[mypy-server.apps.*.models]
# FIXME: remove this line, when `django-stubs` will stop
# using `Any` inside.
disallow_any_explicit = False
[doc8]
ignore-path = docs/_build
max-line-length = 80
sphinx = True