-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
259 lines (246 loc) · 7.56 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
# WeMakePythonStyleGuide:
# https://wemake-python-stylegui.de/en/latest/index.html
# https://wemake-python-stylegui.de/en/latest/pages/usage/configuration.html
# https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html
# http://pycodestyle.pycqa.org/en/latest/intro.html
# http://flake8.pycqa.org/en/latest/user/configuration.html
# http://flake8.pycqa.org/en/latest/user/options.html
# http://flake8.pycqa.org/en/latest/user/error-codes.html
# http://flake8.pycqa.org/en/latest/user/violations.html
# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
# https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/plugins.html
# http://flake8.pycqa.org/en/latest/user/options.html?highlight=per-file-ignores#cmdoption-flake8-per-file-ignores
[flake8]
# Wemake Python Style Guide Configuration
jobs = 4
min-name-length = 1
# We don't control ones who use our code
i-control-code = False
nested-classes-whitelist =
Meta,
NewDate,
# Max of noqa in a module
max-noqa-comments = 10
max-annotation-complexity = 4
max-returns = 5
max-awaits = 5
max-local-variables = 20
max-name-length = 60
# Max of expressions in a function
max-expressions = 15
# Max args in a function
max-arguments = 15
# Max classes and functions in a single module
max-module-members = 35
max-methods = 25
# Max line complexity measured in AST nodes
max-line-complexity = 24
# Max Jones Score for a module: the median of all lines complexity sum
max-jones-score = 15
# Max amount of cognitive complexity per function
max-cognitive-score = 20
# Max amount of cognitive complexity per module
max-cognitive-average = 10
max-imports = 25
max-imported-names = 50
# Max of expression usages in a module
max-module-expressions = 15
# Max of expression usages in a function
max-function-expressions = 15
max-base-classes = 5
max-decorators = 6
# Max of repeated string constants in your modules
max-string-usages = 15
max-try-body-length = 15
max-asserts = 15
# Max number of access level in an expression
max-access-level = 6
# maximum number of public instance attributes
max-attributes = 20
max-line-length = 120
max-doc-length = 120
# https://pypi.org/project/flake8-quotes/
inline-quotes = double
multiline-quotes = double
docstring-quotes = double
# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
show-source = True
# Print total number of errors
count = True
statistics = True
# benchmark = True
exclude =
.tox,
migrations,
dist,
build,
hadoop_archive_plugin,
virtualenv,
venv,
venv36,
ve,
.venv,
tox.ini,
dags,
setup.py,
docs,
# https://github.com/peterjc/flake8-rst-docstrings/pull/16
rst-directives =
# These are sorted alphabetically - but that does not matter
autosummary,data,currentmodule,deprecated,
glossary,moduleauthor,plot,testcode,
versionadded,versionchanged,
rst-roles =
attr,class,func,meth,mod,obj,ref,term,
# Python programming language:
py:func,py:mod,
# https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html
# http://pycodestyle.pycqa.org/en/latest/intro.html
ignore =
# Import at the wrong position
# [buggy with trailing commas and "as <alias>" imports]
# [too much hassle]
# [sometimes flask imports cannot be placed alphabetically]
#FIXME: change where can be done, later switch on
I,
# Found name reserved for first argument: cls [opinionated]
WPS117,
# Found `f` string [opinionated]
WPS305,
# Found explicit string concat [opinionated]
WPS336,
# Found using `@staticmethod` [opinionated]
WPS602,
# Found wrong variable name ("data", "handler", "params") [opinionated]
WPS110,
# Found upper-case . constant in a class (flask config requires uppercase consts) [opinionated]
WPS115,
# WPS223: Found too many `elif` branches
WPS223,
# Found class without a base class (goes against PEP8) [opinionated]
WPS306,
# Found line break before binary operator [goes against PEP8] [opinionated]
W503,
# Found multiline conditions [opinionated]
WPS337,
# Found mutable module constant [opinionated]
WPS407,
# WPS411 Found empty module:
WPS411,
# Found nested import [opinionated]
WPS433,
# Found negated condition [opinionated]
WPS504,
# WPS529:Found implicit `.get()` dict usage
WPS529,
#FIXME: handle with docstring later
# Docstrings [opinionated]
D,
#P101 and P103 string does contain unindexed parameters'
P101,
P103,
# WPS237:Found a too complex `f` string
WPS237,
# WPS316 Found context manager with too many assignments
WPS316,
# WPS323 Found `%` string formatting
WPS323,
# WPS326 Found implicit string concatenation [optional]
WPS326,
# WPS347 Found vague import that may cause confusion
WPS347,
#WPS421 Found wrong function call: locals'
WPS421,
# WPS440 Found block variables overlap
WPS440,
# WPS459 Found comparison with float or complex number [buggy]
WPS459,
# S108 Probable insecure usage of temp file/directory.
S108,
# S404 Consider possible security implications associated with check_call module
S404,
# S603 subprocess call - check for execution of untrusted input
S603,
# S607 Starting a process with a partial executable path
S607,
# S608 Possible SQL injection vector through string-based query construction.
S608,
# E402 module level import not at top of file
E402,
# RST399: Document or section may not begin with a transition.
RST399,
# F821 undefined name
F821,
# WPS432 Found magic number
WPS432,
# WPS615 Found unpythonic getter or setter
WPS615,
# RST213: Inline emphasis start-string without end-string.
RST213,
# RST307: Error in "code" directive
RST307,
# N805 first argument of a method should be named 'self'
N805,
# WPS412 Found `__init__.py` module with logic
WPS412
# http://flake8.pycqa.org/en/latest/user/options.html?highlight=per-file-ignores#cmdoption-flake8-per-file-ignores
per-file-ignores =
__init__.py:
# F401 imported but unused
F401,
# WPS410 Found wrong metadata variable: __all__
WPS410,
test*:
# S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
S101,
# WPS122:Found all unused variables definition
WPS122,
# WPS125 Found builtin shadowing: globals [test setup]
WPS125,
# WPS204:Found overused expression [ok, for test purpose]
WPS204,
# WPS218 Found too many `assert` statements
WPS218,
# WPS219 Found too deep access level [test usage]
WPS219,
# WPS226:Found string constant over-use [ test usage]
WPS226,
# WPS420:Found wrong keyword:
WPS420,
# WPS425 Found boolean non-keyword argument: False
WPS425,
# WPS430 Found nested function [test usage]
WPS430,
# WPS431 Found nested class [test usage]
WPS431,
# WPS432 Found magic number
WPS432,
# WPS437 Found protected attribute usage
WPS437,
# WPS442 Found outer scope names shadowing [ok for test usage]
WPS442,
# WPS517 Found pointless starred expression
WPS517,
# WPS605 Found method without arguments
WPS605,
# WPS609 Found direct magic attribute usage
WPS609,
# S106 Possible hardcoded password [test usage]
S106,
# WPS210 Found too many local variables: 24 > 20
WPS210,
# WPS228 Found too long compare > 3
WPS228,
conftest.py:
# E800 Found commented out code
E800,
# S105 Possible hardcoded password [test usage]
S105,
# WPS442 Found outer scope names shadowing [test usage]
WPS442,
# WPS420 Found wrong keyword
WPS420,
# WPS432 Found magic number: 2020
WPS432
[darglint]
docstring_style = sphinx