-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
149 lines (138 loc) · 4.62 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
[isort]
case_sensitive = true
combine_as_imports = true
dedup_headings = true
float_to_top = true
import_heading_firstparty = Cutesy
import_heading_localfolder = Current App
import_heading_stdlib = Standard Library
import_heading_thirdparty = Third Party
line_length = 99
order_by_type = true
profile = black
sections = FUTURE, STDLIB, THIRDPARTY, FIRSTPARTY, LOCALFOLDER
skip = .git
skip_gitignore = true
[flake8]
format = wemake
no-accept-encodings = True
enable-extensions = G
exclude = bin, lib, dist, prof, build, .pytest_cache, __pycache__, .git
filename = *.py
inline-quotes = double
max-doc-length = 79
max-line-length = 99
min-name-length = 3
# Re-enable some names that are real words or well-understood
allowed-domain-names =
__eq__, pk, db, s3, ui, js, ip,
value, values, result, results, item, items, param, params, arg, args
forbidden-domain-names =
err, foo, bar, baz, quux, foobar, klass
ignore =
# Standard setup to handle commas for the right python version
C813, C814, C815,
# f-strings OK; They are very fast
WPS305,
# Allow raw strings always; IDEs format the regex characters nicely inside them
WPS360,
# Allow inline imports; Sometimes it's best to duck-type instead of building
# out a complex inheritance tree for small use cases.
WPS433,
# Don't worry about authors or formatting on TODOs; Just need links on TODOs
# if they're going to stay in the codebase
T002, T004, T005
# Error categories we don't use a linter for:
# -------------------------------------------
# Complexity
WPS2,
# Additional complexity rules
WPS402, WPS403,
# Required argument documentation
DAR,
# Rules with a broken implementation that we intend to handle better later
# ------------------------------------------------------------------------
# Freeform format strings due to frequent false postives and missed negatives
# due to separation of string and formatting
P,
# Underscore-number name pattern. Will enforce the opposite.
WPS114,
# `%` string formatting rule which checks the string, rather than the
# operator
WPS323,
# Seemingly-broken exception type check with only false positives
WPS329,
# Just-because-you-can rules that reduce expressiveness without improving
# consistency
# -----------------------------------------------------------------------
# Attributes to shadow builtin type names; This is often inevitable
A003,
# Allow logic in __init__ files; It's necessary sometimes
WPS412,
# Positional boolean arguments
WPS425,
# Control variable use after block and overlapping block variable names;
# otherwise we can't use the same variable name for multiple loops, which gets
# very old
WPS440, WPS441,
# Overreaching "getter" restrictions
WPS463, WPS615,
# Nested `try` is OK and necessary to minimize conditions-per-try-block
WPS505,
# Staticmethods; Classes as namespaces for overwritable logic is ok IMO
WPS602,
# Magic attribute access; This is a needed thing
WPS609,
# Super use in unique situations
WPS613,
# Incrementing a counter
SIM113,
# Multiple with statements and duplicate elif cases; Very hard to break these
# lines otherwise
SIM114, SIM117,
# Overreaching docstring inspection
RST306,
# Doublecheck-type rules we avoid:
# --------------------------------
# Ignore constant name sniffing
S106
# Allow use of `subprocess` module
S404, S603,
# Required review of `extra`
S610,
# Explicit divide-by-0
WPS344,
# Protected attribute use; There is already an implicit warning...
WPS437,
# Bitwise OR operator
WPS465,
# Duplicates/conflicts between packages:
# ----------------------------
# Whitespace around colons is handled by `black`, see
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices
E203,
# Suppress import-not-at-top warning; This is handled by `black`, and fires a
# false positive when we're explicitly disabling isort.
E402,
# Duplicate from flake8-builtins
WPS125,
# Allow relative imports, which make apps portable. `absolufy-imports` makes
# imports relative for us automatically when running `make format`.
WPS300,
# Required (object) after class declaration; The opposite is enforced by a
# different plugin
WPS306,
# `black --check` handles this multiline parameter issue, so ignore the
# multiline parameter check until tuple bug is fixed (https://bit.ly/3jdjTmL)
WPS317,
# Allow lines that start with a dot; `black` handles this well
WPS348,
# Allow `black` to put binary operators at the beginning
W503,
# Duplicates of SIM101, SIM201, SIM115
WPS508, WPS511, WPS515
per_file_ignores =
# Allow some patterns and arbitrary input that is common in testing. Also allow
# nested classes since we frequently test enum definition.
tests/*:WPS431,WPS432,WPS441
multiline-quotes = """