|
| 1 | +[flake8] |
| 2 | + |
| 3 | +# Print the total number of errors: |
| 4 | +count = true |
| 5 | + |
| 6 | +# Don't even try to analyze these: |
| 7 | +extend-exclude = |
| 8 | + # GitHub configs |
| 9 | + .github, |
| 10 | + # Cache files of MyPy |
| 11 | + .mypy_cache, |
| 12 | + # Cache files of pytest |
| 13 | + .pytest_cache, |
| 14 | + # Countless third-party libs in venvs |
| 15 | + .tox, |
| 16 | + # Occasional virtualenv dir |
| 17 | + .venv, |
| 18 | + # VS Code |
| 19 | + .vscode, |
| 20 | + # Metadata of `pip wheel` cmd is autogenerated |
| 21 | + pip-wheel-metadata, |
| 22 | + |
| 23 | +# IMPORTANT: avoid using ignore option, always use extend-ignore instead |
| 24 | +# Completely and unconditionally ignore the following errors: |
| 25 | +extend-ignore = |
| 26 | + # Legitimate cases, no need to "fix" these violations: |
| 27 | + # D202: No blank lines allowed after function docstring, conflicts with `ruff format` |
| 28 | + D202, |
| 29 | + # E203: whitespace before ':', conflicts with `ruff format` |
| 30 | + E203, |
| 31 | + # E501: "line too long", its function is replaced by `flake8-length` |
| 32 | + E501, |
| 33 | + # W505: "doc line too long", its function is replaced by `flake8-length` |
| 34 | + W505, |
| 35 | + # I: flake8-isort is drunk + we have isort integrated into pre-commit |
| 36 | + I, |
| 37 | + # WPS305: "Found f string" -- nothing bad about this |
| 38 | + WPS305, |
| 39 | + # WPS322: "Found incorrect multi-line string" -- false-positives with |
| 40 | + # attribute docstrings. Ref: |
| 41 | + # https://github.com/wemake-services/wemake-python-styleguide/issues/3056 |
| 42 | + WPS322, |
| 43 | + # WPS326: "Found implicit string concatenation" -- nothing bad about this |
| 44 | + WPS326, |
| 45 | + # WPS428: "Found statement that has no effect" -- false-positives with |
| 46 | + # attribute docstrings. Ref: |
| 47 | + # https://github.com/wemake-services/wemake-python-styleguide/issues/3056 |
| 48 | + WPS428, |
| 49 | + # WPS462: "Wrong multiline string usage" -- false-positives with |
| 50 | + # attribute docstrings. Ref: |
| 51 | + # https://github.com/wemake-services/wemake-python-styleguide/issues/3056 |
| 52 | + WPS462, |
| 53 | + # WPS300: "Forbid imports relative to the current folder" -- we use relative imports |
| 54 | + WPS300, |
| 55 | + |
| 56 | +# https://wemake-python-styleguide.readthedocs.io/en/latest/pages/usage/formatter.html |
| 57 | +format = wemake |
| 58 | + |
| 59 | +# Let's not overcomplicate the code: |
| 60 | +max-complexity = 10 |
| 61 | + |
| 62 | +# Accessibility/large fonts and PEP8 friendly. |
| 63 | +# This is being flexibly extended through the `flake8-length`: |
| 64 | +max-line-length = 79 |
| 65 | + |
| 66 | +# Allow certain violations in certain files: |
| 67 | +# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future |
| 68 | +per-file-ignores = |
| 69 | + # The following ignores have been researched and should be considered permanent |
| 70 | + # each should be preceded with an explanation of each of the error codes |
| 71 | + # If other ignores are added for a specific file in the section following this, |
| 72 | + # these will need to be added to that line as well. |
| 73 | + |
| 74 | + tests/pytest/_cli_test.py: |
| 75 | + # WPS431: "Forbid nested classes" -- this is a legitimate use case for tests |
| 76 | + WPS431, |
| 77 | + # WPS226: "Forbid the overuse of string literals" -- this is a legitimate use case for tests |
| 78 | + WPS226, |
| 79 | + # WPS115: "Require snake_case for naming class attributes" -- testing legitimate case, ignored in main code |
| 80 | + WPS115, |
| 81 | + # We will not spend time on fixing complexity in deprecated hook |
| 82 | + src/pre_commit_terraform/terraform_docs_replace.py: WPS232 |
| 83 | + |
| 84 | +# Count the number of occurrences of each error/warning code and print a report: |
| 85 | +statistics = true |
| 86 | + |
| 87 | +# ## Plugin-provided settings: ## |
| 88 | + |
| 89 | +# flake8-eradicate |
| 90 | +# E800: |
| 91 | +eradicate-whitelist-extend = isort:\s+\w+ |
| 92 | + |
| 93 | +# flake8-pytest-style |
| 94 | +# PT001: |
| 95 | +pytest-fixture-no-parentheses = true |
| 96 | +# PT006: |
| 97 | +pytest-parametrize-names-type = tuple |
| 98 | +# PT007: |
| 99 | +pytest-parametrize-values-type = tuple |
| 100 | +pytest-parametrize-values-row-type = tuple |
| 101 | +# PT023: |
| 102 | +pytest-mark-no-parentheses = true |
| 103 | + |
| 104 | +# wemake-python-styleguide |
| 105 | +# WPS410: "Forbid some module-level variables" -- __all__ is a legitimate use case |
| 106 | +allowed-module-metadata = __all__ |
| 107 | + |
| 108 | +show-source = true |
0 commit comments