forked from antonbabenko/pre-commit-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.flake8
More file actions
108 lines (94 loc) · 3.62 KB
/
.flake8
File metadata and controls
108 lines (94 loc) · 3.62 KB
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
[flake8]
# Print the total number of errors:
count = true
# Don't even try to analyze these:
extend-exclude =
# GitHub configs
.github,
# Cache files of MyPy
.mypy_cache,
# Cache files of pytest
.pytest_cache,
# Countless third-party libs in venvs
.tox,
# Occasional virtualenv dir
.venv,
# VS Code
.vscode,
# 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:
# D202: No blank lines allowed after function docstring, conflicts with `ruff format`
D202,
# E203: whitespace before ':', conflicts with `ruff format`
E203,
# E501: "line too long", its function is replaced by `flake8-length`
E501,
# W505: "doc line too long", its function is replaced by `flake8-length`
W505,
# I: flake8-isort is drunk + we have isort integrated into pre-commit
I,
# WPS305: "Found f string" -- nothing bad about this
WPS305,
# 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,
# 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,
# WPS300: "Forbid imports relative to the current folder" -- we use relative imports
WPS300,
# https://wemake-python-styleguide.readthedocs.io/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.
tests/pytest/_cli_test.py:
# WPS431: "Forbid nested classes" -- this is a legitimate use case for tests
WPS431,
# WPS226: "Forbid the overuse of string literals" -- this is a legitimate use case for tests
WPS226,
# WPS115: "Require snake_case for naming class attributes" -- testing legitimate case, ignored in main code
WPS115,
# We will not spend time on fixing complexity in deprecated hook
src/pre_commit_terraform/terraform_docs_replace.py: WPS232
# 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+
# 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
# wemake-python-styleguide
# WPS410: "Forbid some module-level variables" -- __all__ is a legitimate use case
allowed-module-metadata = __all__
show-source = true