forked from wemake-services/wemake-python-styleguide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
266 lines (222 loc) · 5.7 KB
/
pyproject.toml
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
[tool.poetry]
name = "wemake-python-styleguide"
version = "0.19.2"
description = "The strictest and most opinionated python linter ever"
license = "MIT"
authors = [
"Nikita Sobolev <[email protected]>"
]
readme = "README.md"
repository = "https://github.com/wemake-services/wemake-python-styleguide"
homepage = "https://wemake-python-styleguide.rtfd.io"
keywords = [
"flake8",
"flake8-plugin",
"flake8-formatter",
"linter",
"wemake.services",
"styleguide",
"code quality",
"pycqa"
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Framework :: Flake8",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Typing :: Typed",
]
[tool.poetry.urls]
"Funding" = "https://opencollective.com/wemake-python-styleguide"
[tool.poetry.plugins."flake8.extension"]
WPS = "wemake_python_styleguide.checker:Checker"
[tool.poetry.plugins."flake8.report"]
wemake = "wemake_python_styleguide.formatter:WemakeFormatter"
[tool.poetry.dependencies]
python = "^3.10"
flake8 = "^7.1"
attrs = "*"
typing_extensions = ">=4.0"
pygments = "^2.4"
[tool.poetry.group.dev.dependencies]
pytest = "^8.1"
pytest-cov = "^6.0"
pytest-randomly = "^3.12"
covdefaults = "^2.3"
syrupy = "^4.6"
hypothesis = "^6.35"
hypothesmith = "^0.3"
mypy = "^1.13"
types-flake8 = "^7.1"
import-linter = "^2.0"
astpath = "^0.9"
lxml = "^5.1"
nbqa = "^1.2"
ruff = "^0.8"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
sphinx = ">=7.1,<9.0"
sphinx-autodoc-typehints = "^2.0"
sphinxcontrib-mermaid = "^1.0"
added-value = "^0.24"
tomli = "^2.0"
myst-parser = "^4.0"
[build-system]
requires = ["poetry-core>=1.9.0"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
# Ruff config: https://docs.astral.sh/ruff/settings
fix = true
target-version = "py310"
line-length = 80
extend-exclude = [
# Intentional bad code:
"tests/fixtures/**",
"tests/**/__snapshots__/**",
# 3rd party:
"wemake_python_styleguide/logic/tokens/docstrings.py",
]
[tool.ruff.format]
quote-style = "single"
docstring-code-format = false
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # maccabe
"COM", # flake8-commas
"D", # pydocstyle
# TODO: enable once it gets out of preview:
# "DOC", # pydoclint
"DTZ", # flake8-datetimez
"E", # pycodestyle
"ERA", # flake8-eradicate
"EXE", # flake8-executable
"F", # pyflakes
"FLY", # pyflint
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PERF", # perflint
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff
"PIE", # flake8-pie
"S", # flake8-bandit
"N", # pep8-naming
"SLOT", # flake8-slots
"SIM", # flake8-simpify
"T100", # flake8-debugger
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
# Different doc rules that we don't really care about:
"D100",
"D104",
"D106",
"D203",
"D212",
"D401",
"D404",
"D405",
"COM812", # trailing comma, conflicts with `ruff format`
"ISC001", # implicit string concat conflicts with `ruff format`
"ISC003", # prefer explicit string concat over implicit concat
"TRY003", # long exception messages from `tryceratops`
"RUF001", # <
"RUF002", # | allow non-ascii letters
"RUF100", # conflicts with flake8
]
[tool.ruff.lint.mccabe]
max-complexity = 6
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
[tool.ruff.lint.per-file-ignores]
"wemake_python_styleguide/visitors/ast/*.py" = ["N802"]
"tests/*.py" = [
"S101", # asserts
"S105", # hardcoded passwords
"S603", # do not require `shell=True`
"S607", # partial executable paths
]
"wemake_python_styleguide/types.py" = ["D102"]
[tool.mypy]
# The mypy configurations: http://bit.ly/2zEl9WI
ignore_missing_imports = true
strict = true
warn_unreachable = true
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",
]
[[tool.mypy.overrides]]
module = "wemake_python_styleguide.compat.nodes"
# We allow explicit `Any` only in this file, because of the compatibility:
disallow_any_explicit = false
[[tool.mypy.overrides]]
module = "wemake_python_styleguide.compat.packaging"
# We allow unused `ignore` comments, because we cannot sync it between versions:
warn_unused_ignores = false
[tool.pytest.ini_options]
# pytest config: http://doc.pytest.org/en/latest/customize.html
# Strict `@xfail` by default:
xfail_strict = true
# Ignore deprecation warnings:
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",
]
norecursedirs = [
"tests/fixtures",
"*.egg",
".eggs",
"dist",
"build",
"docs",
".tox",
".git",
"__pycache__",
]
[tool.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 = [
# Does not contain runtime logic:
"wemake_python_styleguide/types.py",
# Copied from 3rd party:
"wemake_python_styleguide/logic/tokens/docstrings.py",
]
# Here we specify plugins for coverage to be used:
plugins = [
"covdefaults",
]