forked from dry-python/returns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
223 lines (189 loc) · 5.81 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# All configuration for plugins and other utils is defined here.
# Read more about `setup.cfg`:
# https://docs.python.org/3/distutils/configfile.html
[flake8]
format = wemake
show-source = True
doctests = True
statistics = False
# darglint configuration:
# https://github.com/terrencepreilly/darglint
strictness = long
docstring-style = numpy
# Plugins:
max-complexity = 6
max-line-length = 80
staticmethod-decorators =
staticmethod
law_definition
# wemake-python-styleguide
max-annotation-complexity = 4
i-control-code = False
allowed-domain-names = some, result, do
extend-exclude =
.venv
build
# Bad code that I write to test things:
ex.py
experiments
# Pattern matching, flake8 and friends are not ready to deal with it
# Remove these lines when https://github.com/PyCQA/pyflakes/pull/630 is merged
tests/test_examples/test_result/test_result_pattern_matching.py
tests/test_examples/test_maybe/test_maybe_pattern_matching.py
tests/test_examples/test_io/test_ioresult_container/test_ioresult_pattern_matching.py
tests/test_pattern_matching.py
ignore =
D100,
D104,
D401,
W504,
X100,
Y021,
WPS113,
WPS201,
WPS202,
WPS214,
WPS215,
WPS235,
WPS320,
WPS433,
WPS436,
WPS440,
WPS450,
WPS612,
RST303,
RST304,
DAR103,
DAR203,
per-file-ignores =
# We allow reexport:
returns/pointfree/__init__.py: F401, WPS201
returns/methods/__init__.py: F401, WPS201
returns/pipeline.py: F401
returns/context/__init__.py: F401, WPS201
# Disable some quality checks for the most heavy parts:
returns/io.py: WPS402
returns/iterables.py: WPS234
# Interfaces and asserts can have assert statements:
returns/interfaces/*.py: S101
returns/primitives/asserts.py: S101
# Some rules cannot be applied to context:
returns/context/*.py: WPS201, WPS204, WPS226, WPS326, WPS430
# We allow `futures` to do attribute access:
returns/future.py: WPS437
returns/_internal/futures/*.py: WPS204, WPS433, WPS437
# We allow a lot of durty hacks in our plugins:
returns/contrib/mypy/*.py: S101, WPS201
returns/contrib/pytest/__init__.py: F401
returns/contrib/pytest/plugin.py: WPS201, WPS430, WPS437, WPS609
returns/contrib/hypothesis/*.py: WPS437, WPS609
# TODO: remove after [email protected]
returns/contrib/mypy/_typeops/visitor.py: S101, WPS232
# There are multiple assert's in tests:
tests/*.py: S101, WPS204, WPS218, WPS226, WPS432, WPS436
# Some examples don't have any docs on purpose:
tests/test_examples/*: D102
# Pattern matching, flake8 and friends are not ready to deal with it
tests/test_examples/test_result/test_result_pattern_matching.py: D103, WPS110, WPS125, WPS421, WPS432
tests/test_examples/test_maybe/test_maybe_pattern_matching.py: D101, D103, F811, WPS306, WPS421
tests/test_examples/test_io/test_ioresult_container/test_ioresult_pattern_matching.py: WPS110, WPS421, WPS432
tests/test_pattern_matching.py: S101, WPS110, WPS218, WPS432
# Annotations:
*.pyi: D103, WPS112, WPS211, WPS428
[isort]
# isort configuration:
# https://pycqa.github.io/isort/docs/configuration/profiles.html
profile = wemake
[tool:pytest]
# ignores some directories:
norecursedirs = *.egg .eggs dist build docs .tox .git __pycache__
# Active the strict mode of xfail
xfail_strict = true
# Adds these options to each `pytest` run:
addopts =
--strict-markers
--strict-config
--doctest-modules
--doctest-glob='*.rst'
# pytest-cov:
--cov=returns
--cov-report=term-missing:skip-covered
--cov-report=html
--cov-report=xml
--cov-branch
--cov-fail-under=100
# pytest-mypy-plugin:
--mypy-ini-file=setup.cfg
# hypothesis, temporary solution:
-p 'no:hypothesispytest'
# Ignores some warnings inside:
filterwarnings =
ignore:coroutine '\w+' was never awaited:RuntimeWarning
[coverage:run]
omit =
# We test mypy plugins with `pytest-mypy-plugins`,
# which does not work with coverage:
returns/contrib/mypy/*
# pytest cannot measure self coverage:
returns/contrib/pytest/*.py
# Hypothesis is also excluded:
returns/contrib/hypothesis/*
[coverage:report]
exclude_lines =
# a more strict default pragma
\# pragma: no cover\b
^if TYPE_CHECKING:
[mypy]
# mypy configurations: http://bit.ly/2zEl9WI
# Custom plugins:
plugins =
returns.contrib.mypy.returns_plugin
enable_error_code =
truthy-bool,
# We don't want "Are you missing an await?" errors,
# because we can't disable them for tests only.
# It is passed as a CLI arg in CI.
# unused-awaitable,
redundant-expr
# We run mypy on all python versions, but only 3.10+ supports pattern matching:
exclude = .*test_.*pattern_matching
disable_error_code = empty-body
# We cannot work without explicit `Any` types and plain generics:
# disallow_any_explicit = True
# disallow_any_generics = True
allow_redefinition = False
check_untyped_defs = True
disallow_untyped_calls = True
follow_imports = silent
ignore_errors = False
ignore_missing_imports = True
implicit_reexport = False
strict_optional = True
strict_equality = True
no_implicit_optional = True
local_partial_types = True
warn_no_return = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_return_any = True
warn_unused_configs = True
warn_unreachable = True
# We need this to debug `mypy` plugin:
show_traceback = True
# TODO: Enable this later, it's disabled temporarily while we don't discover why
# the explicit restriction on `typeshed.stdlib.unittest.mock`,
# which is the next section, is not working properly when running
# with `pytest`.
disallow_subclassing_any = False
[mypy-typeshed.stdlib.unittest.mock]
disallow_subclassing_any = False
[doc8]
# doc8 configuration: https://pypi.org/project/doc8/
ignore-path = docs/_build
max-line-length = 80
sphinx = True
ignore-path-errors=docs/pages/railway.rst;D000
[codespell]
# codespell configuration: https://pypi.org/project/codespell
ignore-words-list = appliable,falsy
skip = __pycache__,_build,.mypy_cache