-
Notifications
You must be signed in to change notification settings - Fork 14
/
.flake8
174 lines (158 loc) · 6.86 KB
/
.flake8
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
[flake8]
# Print the total number of errors:
count = true
# Don't even try to analyze these:
extend-exclude =
# Circle CI configs
.circleci,
# No need to traverse egg info dir
*.egg-info,
# GitHub configs
.github,
# Cache files of MyPy
.mypy_cache,
# Cache files of pytest
.pytest_cache,
# Temp dir of pytest-testmon
.tmontmp,
# Countless third-party libs in venvs
.tox,
# Occasional virtualenv dir
.venv,
# VS Code
.vscode,
# Temporary build dir
build,
# This contains sdists and wheels that we don't want to check
dist,
# Metadata of `pip wheel` cmd is autogenerated
pip-wheel-metadata,
# IMPORTANT: avoid using ignore option, always use extend-ignore instead
# Completely and unconditionally ignore the following errors:
extend-ignore =
# Legitimate cases, no need to "fix" these violations:
# E501: "line too long", its function is replaced by `flake8-length`
E501,
# I: isort-handled
I,
# W505: "doc line too long", its function is replaced by `flake8-length`
W505,
# S101: MyPy requires `asserts`, plus they're not bad if cooked well
S101,
# WPS300: "Found local folder import" -- nothing bad about this
WPS300,
# WPS305: "Found f string" -- nothing bad about this
WPS305,
# An opposite consistency expectation is currently enforced
# by pylint via: useless-object-inheritance (R0205):
# WPS306: "Found class without a base class: *" -- nothing bad about this
WPS306,
# WPS317 enforces weird indents
WPS317,
# WPS318 enforces weird indents too
WPS318,
# WPS322: "Found incorrect multi-line string" -- false-positives with
# attribute docstrings. Ref:
# https://github.com/wemake-services/wemake-python-styleguide/issues/3056
WPS322,
# WPS326: "Found implicit string concatenation" -- nothing bad about this
WPS326,
# WPS332: "Found walrus operator" -- ain't nothing bad about this
WPS332,
# WPS422: "Found future import: *" -- we need these for multipython
WPS422,
# WPS428: "Found statement that has no effect" -- false-positives with
# attribute docstrings. Ref:
# https://github.com/wemake-services/wemake-python-styleguide/issues/3056
WPS428,
# WPS462: "Wrong multiline string usage" -- false-positives with
# attribute docstrings. Ref:
# https://github.com/wemake-services/wemake-python-styleguide/issues/3056
WPS462,
# IMPORTANT: avoid using select option, always use extend-select instead
# Enable the following errors:
extend-select =
# B950: "line too long", longer than `max-line-length` + 10%
B950,
# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
format = wemake
# Let's not overcomplicate the code:
max-complexity = 10
# Accessibility/large fonts and PEP8 friendly.
# This is being flexibly extended through the `flake8-length`:
max-line-length = 79
# Allow certain violations in certain files:
# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future
per-file-ignores =
# The following ignores have been researched and should be considered permanent
# each should be preceded with an explanation of each of the error codes
# If other ignores are added for a specific file in the section following this,
# these will need to be added to that line as well.
# There are multiple `assert`s (S101)
# and subprocesses (import – S404; call – S603) in tests;
# there are also password checks (S105);
# plus, we don't care about the security of temporary directories in tests (S108);
# also, using fixtures looks like shadowing the outer scope (WPS442);
# nested functions are often necessary for mocking (WPS430);
# furthermore, we should be able to import and test private attributes
# (WPS450) and modules (WPS436), and finally it's impossible to
# have <= members in tests (WPS202), including many local vars (WPS210),
# `pytest.raises()` allows inspecting the exception outside the CM (WPS441),
# additionally test docstrings don't need param lists (DAR, DCO020):
tests/**.py: DAR, DCO020, S101, S105, S108, S404, S603, WPS202, WPS210, WPS430, WPS436, WPS441, WPS442, WPS450
# The following ignores must be fixed and the entries removed from this config:
src/awx_plugins/credentials/aim.py: ANN003, ANN201, B950, CCR001, D100, D103, LN001, Q003, WPS210, WPS221, WPS223, WPS231, WPS336, WPS432
src/awx_plugins/credentials/aws_secretsmanager.py: ANN003, ANN201, D100, D103, WPS111, WPS210, WPS329, WPS529
src/awx_plugins/credentials/azure_kv.py: ANN003, ANN201, D100, D103, WPS111, WPS361, WPS421
src/awx_plugins/credentials/centrify_vault.py: ANN003, ANN201, D100, D103, N802, P101, WPS210, WPS229
src/awx_plugins/credentials/conjur.py: ANN003, ANN201, B950, D100, D103, E800, P101, WPS111, WPS210, WPS229, WPS432, WPS440
src/awx_plugins/credentials/dsv.py: ANN003, ANN201, D100, D103, P103, WPS210
src/awx_plugins/credentials/hashivault.py: ANN003, ANN201, B950, C901, CCR001, D100, D103, LN001, N400, WPS202, WPS204, WPS210, WPS221, WPS223, WPS229, WPS231, WPS232, WPS331, WPS336, WPS337, WPS432, WPS454
src/awx_plugins/credentials/injectors.py: ANN001, ANN201, ANN202, C408, D100, D103, WPS110, WPS111, WPS202, WPS210, WPS347, WPS433, WPS440
src/awx_plugins/credentials/plugin.py: ANN001, ANN002, ANN101, ANN201, ANN204, B010, D100, D101, D103, D105, D107, D205, D400, E731, WPS432, WPS433, WPS440, WPS442, WPS601
src/awx_plugins/credentials/plugins.py: B950,D100, D101, D103, D105, D107, D205, D400, LN001, WPS204, WPS229, WPS433, WPS440
src/awx_plugins/credentials/tss.py: ANN003, ANN201, D100, D103, E712, WPS433, WPS440, WPS503
src/awx_plugins/inventory/plugins.py: ANN001, ANN002, ANN003, ANN101, ANN102, ANN201, ANN202, ANN206, B950, C812, C819, D100, D101, D102, D205, D209, D400, D401, LN001, LN002, N801, WPS110, WPS111, WPS202, WPS210, WPS214, WPS301, WPS319, WPS324, WPS331, WPS336, WPS337, WPS338, WPS347, WPS421, WPS433, WPS450, WPS510, WPS529
tests/credential_plugins_test.py: ANN101, B017, C419, D100, D102, D103, D205, D209, D400, DAR, PT011, S105, WPS111, WPS117, WPS118, WPS202, WPS352, WPS421, WPS433, WPS507, WPS441
tests/importable_test.py: ANN101, DAR
# Count the number of occurrences of each error/warning code and print a report:
statistics = true
# ## Plugin-provided settings: ##
# flake8-eradicate
# E800:
eradicate-whitelist-extend = isort:\s+\w+|Ref:\s+https?:\/\/
# flake8-pytest-style
# PT001:
pytest-fixture-no-parentheses = true
# PT006:
pytest-parametrize-names-type = tuple
# PT007:
pytest-parametrize-values-type = tuple
pytest-parametrize-values-row-type = tuple
# PT023:
pytest-mark-no-parentheses = true
# flake8-rst-docstrings
rst-directives =
spelling
rst-roles =
# Built-in Sphinx roles:
class,
data,
file,
exc,
meth,
mod,
term,
py:class,
py:data,
py:exc,
py:meth,
py:term,
# Sphinx's internal role:
event,
# wemake-python-styleguide
i-control-code = false
# WPS226:
max-string-usages = 85
show-violation-links = true
show-source = true