-
-
Notifications
You must be signed in to change notification settings - Fork 120
/
setup.cfg
179 lines (149 loc) · 4.76 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
# 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
# wemake-python-styleguide
max-annotation-complexity = 5
allowed-domain-names = some, result, do
select = WPS, E999
extend-exclude =
.venv
build
# Bad code that I write to test things:
ex.py
experiments
ignore =
WPS113,
WPS201,
WPS202,
WPS214,
WPS215,
WPS235,
WPS320,
WPS412,
WPS433,
WPS436,
WPS440,
WPS450,
WPS612,
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: WPS402
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, WPS402, WPS430, WPS437
returns/contrib/hypothesis/*.py: WPS437
# TODO: remove after mypy@0.800
returns/contrib/mypy/_typeops/visitor.py: S101, WPS232
# Allow class attributes literals for slots and setattr:
returns/primitives/container.py: WPS226
# 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
line_length = 80
[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
# 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/*
plugins =
covdefaults
[mypy]
# mypy configurations: http://bit.ly/2zEl9WI
# Custom plugins:
plugins =
mypy.plugins.proper_plugin,
returns.contrib.mypy.returns_plugin,
enable_error_code =
truthy-bool,
truthy-iterable,
redundant-expr,
# 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,
# ignore-without-code,
possibly-undefined,
redundant-self,
# We run mypy on all python versions, but only 3.10+ supports pattern matching:
exclude = .*test_.*pattern_matching
disable_error_code = empty-body, no-untyped-def
# We cannot work without explicit `Any` types and plain generics:
disallow_any_explicit = false
disallow_any_generics = false
follow_imports = silent
ignore_missing_imports = true
strict = true
warn_unreachable = true
# TODO: update our output assertions to match a new syntax
force_uppercase_builtins = true
force_union_syntax = 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
[codespell]
# codespell configuration: https://pypi.org/project/codespell
ignore-words-list = appliable,falsy
skip = __pycache__,_build,.mypy_cache