-
-
Notifications
You must be signed in to change notification settings - Fork 378
/
setup.cfg
176 lines (143 loc) · 4.71 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
# All configuration for plugins and other utils is defined here.
# Read more about `setup.cfg`:
# https://docs.python.org/3/distutils/configfile.html
# === Linter configuration ===
# You can reuse this configuration in your own projects.
# See: https://wemake-python-styleguide.rtfd.io/en/latest/pages/usage/integrations/nitpick.html
[flake8]
# Base flake8 configuration:
# https://flake8.pycqa.org/en/latest/user/configuration.html
format = wemake
show-source = true
statistics = false
doctests = true
# Plugins:
max-complexity = 6
max-line-length = 80
# darglint configuration:
# https://github.com/terrencepreilly/darglint
strictness = long
docstring-style = numpy
# Self settings:
max-imports = 17
# Excluding some directories:
exclude =
.git
__pycache__
.venv
.eggs
*.egg
dist
# These folders contain code badly written for reasons:
# Project specific, do not copy.
tests/fixtures/**
tests/**/__snapshots__/**
# Exclude some pydoctest checks globally:
ignore = D100, D104, D401, W504, RST303, RST304, DAR103, DAR203
per-file-ignores =
# These function names are part of 3d party API:
wemake_python_styleguide/visitors/ast/*.py: N802
# These modules should contain a lot of classes:
wemake_python_styleguide/violations/*.py: WPS202
# Eval is a complex task:
wemake_python_styleguide/logic/safe_eval.py: WPS232
# This module should contain magic numbers:
wemake_python_styleguide/options/defaults.py: WPS432
# Compat/nodes is just pure nuts:
wemake_python_styleguide/compat/nodes.py: WPS113, WPS433, WPS440
# Checker has a lot of imports:
wemake_python_styleguide/checker.py: WPS201
# Allows mypy type hinting, `Ellipsis`` usage, multiple methods:
wemake_python_styleguide/types.py: D102, WPS214, WPS220, WPS428
# There are multiple fixtures, `assert`s, and subprocesses in tests:
tests/test_visitors/test_ast/test_naming/conftest.py: WPS202
tests/*.py: S101, S105, S404, S603, S607, WPS211, WPS226, WPS323
# Docs can have the configuration they need:
docs/conf.py: WPS407
# Pytest fixtures
tests/plugins/*.py: WPS442
[isort]
# isort configuration:
# https://pycqa.github.io/isort/docs/configuration/profiles.html
profile = wemake
# TODO: remove after this PR is merged and released:
# https://github.com/PyCQA/isort/pull/2241
line_length = 80
# We need these lines for Github Action to work correctly,
# **please** do not copy it to your own configs:
default_section = THIRDPARTY
known_first_party = wemake_python_styleguide*
skip_glob =
# These folders contain code badly written for reasons:
tests/fixtures/**
tests/**/snapshots/**
# === Internal tools ===
# You are not interested in anything beyond this line.
[tool:pytest]
# py.test configuration: http://doc.pytest.org/en/latest/customize.html
norecursedirs = tests/fixtures *.egg .eggs dist build docs .tox .git __pycache__
filterwarnings =
ignore::DeprecationWarning
# Strict `@xfail` by default:
xfail_strict = true
addopts =
--strict
--doctest-modules
--cov=wemake_python_styleguide
--cov-branch
--cov-report=term-missing:skip-covered
--cov-report=html
--cov-report=xml
--cov-fail-under=100
[coverage:run]
# Coverage configuration: https://coverage.readthedocs.io/
# We don't need to cover some files. They are fully checked with mypy.
# And don't contain any logic.
omit =
wemake_python_styleguide/types.py
# Here we specify plugins for coverage to be used:
plugins =
coverage_conditional_plugin
[coverage:coverage_conditional_plugin]
# Here we specify our pragma rules for conditional coverage:
rules =
# 3.10
"sys_version_info < (3, 10)": py-lt-310
"sys_version_info >= (3, 10)": py-gte-310
# 3.11
"sys_version_info < (3, 11)": py-lt-311
"sys_version_info >= (3, 11)": py-gte-311
# 3.12
"sys_version_info < (3, 12)": py-lt-312
"sys_version_info >= (3, 12)": py-gte-312
[mypy]
# The mypy configurations: http://bit.ly/2zEl9WI
enable_error_code =
truthy-bool,
truthy-iterable,
redundant-expr,
unused-awaitable,
# ignore-without-code,
possibly-undefined,
redundant-self,
mutable-override,
unimported-reveal,
disable_error_code =
no-untyped-def,
ignore_missing_imports = true
strict = true
warn_unreachable = true
[mypy-wemake_python_styleguide.compat.nodes]
# We allow explicit `Any` only in this file, because of the compatibility:
disallow_any_explicit = false
[mypy-wemake_python_styleguide.compat.packaging]
# We allow unused `ignore` comments, because we cannot sync it between versions:
warn_unused_ignores = false
[mypy-wemake_python_styleguide.logic.safe_eval]
# We allow explicit `Any` only in this file, because that's what it does:
disallow_any_explicit = false
[doc8]
# doc8 configuration: https://pypi.org/project/doc8/
ignore-path = docs/_build
max-line-length = 80
sphinx = true