-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.cfg
448 lines (431 loc) · 12.8 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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# 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
[autoflake]
imports = onetl,pydantic,etl_entities,pyspark,tests
ignore-init-module-imports = true
remove-unused-variables = true
[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 = 25
max-imports = 25
max-imported-names = 60
# 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
#format = '%(path)s:%(row)d:%(col)d: %(code)s %(text)s'
;format = wemake
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,
docker,
Jenkinsfile,
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,
ANN,
# Found name reserved for first argument: cls [opinionated]
WPS117,
# __future__ import "division" missing
FI10,
# __future__ import "absolute_import" missing
FI11,
# __future__ import "with_statement" missing
FI12,
# __future__ import "print_function" missing
FI13,
# __future__ import "unicode_literals" missing
FI14,
# __future__ import "generator_stop" missing
FI15,
# __future__ import "nested_scopes" missing
FI16,
# __future__ import "generators" missing
FI17,
# __future__ import "annotations" present
FI58,
# 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,
# WPS326 Found implicit string concatenation [optional]
WPS326,
# WPS347 Found vague import that may cause confusion
WPS347,
# WPS421 Found wrong function call: locals'
WPS421,
# WPS348 Found a line that starts with a dot
WPS348,
# 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,
# WPS432 Found magic number
WPS432,
# WPS615 Found unpythonic getter or setter
WPS615,
# RST213: Inline emphasis start-string without end-string.
RST213,
# RST304: Unknown interpreted text role
RST304,
# RST307: Error in "code" directive
RST307,
# WPS428 Found statement that has no effect
WPS428,
# WPS462 Wrong multiline string usage
WPS462,
# WPS303 Found underscored number:
WPS303,
# WPS431 Found nested class
WPS431,
# WPS317 Invalid multiline string usage
WPS317,
# WPS226 Found string literal over-use: | [bug]
WPS226,
# WPS323 Found `%` string formatting
WPS323,
# RST305 Undefined substitution referenced: support_hooks
RST305,
# RST303 Unknown directive type tabs
RST303,
# WPS402 Found `noqa` comments overuse
WPS402,
# WPS214 Found too many methods
WPS214,
# WPS605 Found method without arguments
WPS605,
# N805 first argument of a method should be named 'self'
N805,
# WPS238 Found too many raises in a function
WPS238,
# W505: doc line too long
W505,
# E501: line too long
E501,
# WPS114 Found underscored number name pattern: package_spark_2_3
WPS114,
# WPS420 Found wrong keyword pass
WPS420
# WPS600 Found subclassing a builtin: str
WPS600,
# WPS601 Found shadowed class attribute
WPS601,
# WPS604 Found incorrect node inside `class` body: pass
WPS604,
# WPS100 Found wrong module name: util
WPS100,
# WPS436 Found protected module import: onetl._util
# https://github.com/wemake-services/wemake-python-styleguide/issues/1441
WPS436,
# WPS201 Found module with too many imports: 26 > 25
WPS201,
# WPS429 Found multiple assign targets
WPS429,
# https://github.com/wemake-services/wemake-python-styleguide/issues/2847
# E704 multiple statements on one line: def func(): ...
E704,
# WPS474 Found import object collision
WPS474,
# WPS318 Found extra indentation
WPS318,
# WPS410 Found wrong metadata variable: __all__
WPS410
# http://flake8.pycqa.org/en/latest/user/options.html?highlight=per-file-ignores#cmdoption-flake8-per-file-ignores
per-file-ignores =
__init__.py:
# * imports are valid for __init__.py scripts
F403,
WPS347,
WPS440,
# __init__.py scripts may require a lot of imports
WPS235,
# F401 imported but unused
F401,
conftest.py:
# E800 Found commented out code
E800,
# S105 Possible hardcoded password [test usage]
S105,
# WPS442 Found outer scope names shadowing
WPS442,
# WPS432 Found magic number: 2020
WPS432,
# WPS235 Found too many imported names from a module
WPS235,
# WPS202 Found too many module members: 36 > 35
WPS202,
file_result.py:
# E800 Found commented out code
E800,
yaml_hwm_store.py:
# E800 Found commented out code
E800,
# P102 docstring does contain unindexed parameters
P102,
db_writer.py:
# E800 Found commented out code
E800,
kafka.py:
# too few type annotations
TAE001,
*connection.py:
# WPS437 Found protected attribute usage: spark._sc._gateway
WPS437,
onetl/connection/db_connection/jdbc_mixin/connection.py:
# too few type annotations
TAE001,
# WPS219 :Found too deep access level
WPS219,
# WPS437: Found protected attribute usage: spark._jvm
WPS437,
onetl/connection/db_connection/kafka/connection.py:
# WPS342: Found implicit raw string \\n
WPS342,
# WPS437 Found protected attribute usage: self._jvm
WPS437,
onetl/connection/db_connection/kafka/kafka_ssl_protocol.py:
# WPS342: Found implicit raw string \\n
WPS342,
onetl/_util/*:
# WPS437 Found protected attribute usage: spark._jvm
WPS437,
file_filter.py:
onetl/connection/file_connection/file_connection.py:
# WPS220: Found too deep nesting
WPS220,
onetl/connection/file_connection/hdfs/connection.py:
# E800 Found commented out code
E800,
# F401 'hdfs.ext.kerberos.KerberosClient as CheckForKerberosSupport' imported but unused
F401,
# WPS442 Found outer scope names shadowing: KerberosClient
WPS442,
onetl/hooks/slot.py:
# WPS210 Found too many local variables
WPS210,
onetl/_metrics/listener/*:
# N802 function name 'onJobStart' should be lowercase
N802,
tests/*:
# Found too many empty lines in `def`
WPS473,
# TAE001 too few type annotations
TAE001,
# U100 Unused argument
U100,
# WPS220: Found too deep nesting
WPS220,
# WPS231 Found function with too much cognitive complexity
WPS231,
# FI18 __future__ import "annotations" missing
FI18,
# S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
S101,
# S105 Possible hardcoded password
S105,
# 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
WPS219,
# WPS425 Found boolean non-keyword argument: False
WPS425,
# WPS430 Found nested function
WPS430,
# 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,
# WPS609 Found direct magic attribute usage
WPS609,
# WPS325 Found inconsistent `yield` statement
WPS325,
# WPS360 Found an unnecessary use of a raw string
WPS360
# S106 Possible hardcoded password [test usage]
S106,
# WPS118 Found too long name
WPS118,
# WPS235 Found too many imported names from a module
WPS235,
# WPS213 Found too many expressions
WPS213,
# WPS212 Found too many return statements: 7 > 5
WPS212,
# F401 'onetl' imported but unused
F401,
# F811 redefinition of unused 'onetl' from line 72
F811,
# F821: undefined name
F821,
# WPS429: Found multiple assign targets a = b = 'c'
WPS429,
# WPS342: Found implicit raw string
WPS342,
# WPS520 Found compare with falsy constant: == []
WPS520,
# B017 `pytest.raises(Exception)` should be considered evil
B017,
# WPS202 Found too many module members: 40 > 35
WPS202,
# WPS210 Found too many local variables: 21 > 20
WPS210
[darglint]
docstring_style = sphinx
[mypy]
python_version = 3.8
# TODO: remove later
exclude = ^(?=.*file).*
strict_optional = True
# ignore typing in third-party packages
ignore_missing_imports = True
follow_imports = silent
show_error_codes = True
disable_error_code = name-defined, misc
[codespell]
ignore-words-list = INOUT, inout, thirdparty