forked from wemake-services/wemake-python-styleguide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
169 lines (139 loc) · 4.63 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
# 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-stylegui.de/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 spefic, 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
# 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://github.com/timothycrosley/isort/wiki/isort-Settings
include_trailing_comma = true
use_parentheses = true
# See https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output = 3
# Is the same as 80 in flake8:
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
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:
rules =
"sys_version_info < (3, 8)": py-lt-38
"sys_version_info >= (3, 8)": py-gte-38
"sys_version_info < (3, 9)": py-lt-39
"sys_version_info >= (3, 9)": py-gte-39
[mypy]
# The mypy configurations: http://bit.ly/2zEl9WI
allow_redefinition = False
check_untyped_defs = True
disallow_untyped_decorators = True
disallow_any_explicit = True
disallow_any_generics = True
disallow_untyped_calls = True
ignore_errors = False
ignore_missing_imports = True
implicit_reexport = False
local_partial_types = True
strict_optional = True
strict_equality = True
no_implicit_optional = True
warn_unused_ignores = True
warn_redundant_casts = True
warn_unused_configs = True
warn_unreachable = True
warn_no_return = 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