/
pyproject.toml
311 lines (274 loc) · 7.11 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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
[build-system]
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[project]
name = "rstcheck"
requires-python = ">=3.8"
authors = [
{ name = "Steven Myint", email = "git@stevenmyint.com" },
]
maintainers = [
{ name = "Christian Riedel", email = "cielquan@protonmail.com" },
]
description = "Checks syntax of reStructuredText and code blocks nested within it"
readme = "README.rst"
license = { text = "MIT" }
classifiers = [
"Topic :: Software Development :: Quality Assurance",
]
keywords = ["restructuredtext", "rst", "linter", "static-analysis"]
dynamic = ["version"]
dependencies = [
"rstcheck-core >=1.1",
"typer[all] >=0.4.1",
]
[project.scripts]
rstcheck = "rstcheck._cli:main"
[project.optional-dependencies]
sphinx = ["sphinx >=5.0"]
toml = ["tomli >=2.0; python_version<='3.10'"]
testing = [
"pytest >=7.2",
"pytest-cov >=3.0",
"coverage[toml] >=6.0",
"coverage-conditional-plugin >=0.5",
"pytest-sugar >=0.9.5",
"pytest-randomly >=3.0",
]
docs = [
"sphinx >=5.0",
"m2r2 >=0.3.2",
"sphinx-rtd-theme >=1.2",
"sphinxcontrib-spelling >=7.3",
"sphinx-click >=4.0.3",
"sphinx-autobuild >=2021.3.14",
]
type-check = [
"mypy >=1.0",
]
dev = [
"rstcheck[sphinx,toml,testing,docs,type-check]",
"tox >=3.15",
]
[project.urls]
Documentation = "https://rstcheck.readthedocs.io/en/latest/"
Repository = "https://github.com/rstcheck/rstcheck"
Changelog = "https://github.com/rstcheck/rstcheck/blob/main/CHANGELOG.md"
[tool.setuptools_scm]
write_to = "src/rstcheck/__version__.py"
# -- BLACK CONFIG ---------------------------------------------------------------------
[tool.black]
line-length = 100
exclude = "venv/"
include = '\.pyi?$' # single quotes needed
# -- MYPY CONFIG ----------------------------------------------------------------------
[tool.mypy]
show_error_codes = true
strict_optional = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
disallow_any_generics = true
check_untyped_defs = true
implicit_reexport = false
python_version = "3.11" # CHANGE ME
plugins = "pydantic.mypy"
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = false
warn_required_dynamic_aliases = true
warn_untyped_fields = true
# -- RUFF CONFIG ----------------------------------------------------------------------
[tool.ruff]
target-version = "py311"
line-length = 100
output-format = "grouped"
show-fixes = true
show-source = true
task-tags = ["TODO", "FIXME", "XXX", "NOTE", "BUG", "HACK", "CHANGE ME"]
extend-exclude = [
"*venv*/",
"*.bak.*",
]
src = ["src", "tests"]
unfixable = ["ERA001"]
select = [
"A", # flake8-builtins
"AIR", # Airflow
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"ASYNC", # flake8-async
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe
# "COM", # flake8-commas # black does that
"D", # pydocstyle
"DJ", # flake8-django
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EM", # flake8-errmsg
"ERA", # flake8-eradicate
"EXE", # flake8-executable
"F", # pyflakes
"FA", # flake8-future-annotations
"FBT", # flake8-boolean-trap
# "FIX", # flake8-fixme # custom pre-commit hook does with RegEx
"FLY", # flynt
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"NPY", # NumPy-specific rules
"PD", # flake8-vet
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PLC", # Pylint - Convention
"PLE", # Pylint - Error
"PLR", # Pylint - Refactor
"PLW", # Pylint - Warning
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff-specific rules
"RSE", # flake8-raise
"S", # flake8-bandit
"SLF", # flake8-self
"SLOT", # flake8-slots
"SIM", # flake8-simplify
# "T10", # flake8-debugger # pre-commit hook does that
"T20", # flake8-print
"TCH", # flake8-type-checking
# "TD", # flake8-todo
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
# deactivate because unwanted
"ANN101", # type self
"ANN102", # type cls
"E501", # line length
"PT011", # Use match for specific exceptions in pytest.raises
]
[tool.ruff.per-file-ignores]
"**/tests/**" = [
"ARG", # unused arguments
"PLR0913", # Too many arguments to function call
"PLR2004", # Magic value comparison
"S101", # assert used
"SLF001", # Private member accessed
]
"**/tests/**/*_test.py" = [
"FBT001", # Boolean positional arg in function definition
]
"__init__.py" = [
"D104", # Missing docstring in public package
"PLC0414", # useless-import-alias
]
"**/testing/examples/**" = [
"ERA001", # commented out code
]
"docs/source/conf.py" = [
"INP001", # implicit namespace
]
"__version__.py" = ["ALL"]
[tool.ruff.flake8-annotations]
suppress-dummy-args = true
[tool.ruff.flake8-bugbear]
extend-immutable-calls = [
"typer.Argument",
"typer.Option",
]
[tool.ruff.flake8-builtins]
builtins-ignorelist = [
"id",
]
[tool.ruff.flake8-import-conventions.extend-aliases]
"typing" = "t"
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.flake8-type-checking]
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
]
[tool.ruff.isort]
combine-as-imports = true
required-imports = [
"from __future__ import annotations",
]
[tool.ruff.mccabe]
max-complexity = 20
[tool.ruff.pep8-naming]
classmethod-decorators = [
"pydantic.validator",
]
staticmethod-decorators = []
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
max-doc-length = 100
[tool.ruff.pydocstyle]
convention = "pep257"
ignore-decorators = [
"typing.overload",
]
property-decorators = []
[tool.ruff.pylint]
max-args = 6
# -- PYTEST CONFIG --------------------------------------------------------------------
[tool.pytest.ini_options]
addopts = "-ra --showlocals"
mock_use_standalone_module = true
# -- COVERAGE CONFIG ------------------------------------------------------------------
[tool.coverage]
[tool.coverage.run]
plugins = ["coverage_conditional_plugin"]
branch = true
parallel = true
context = "static-context"
omit = [
"tests/*",
]
[tool.coverage.paths]
tox_combine = [
"src/rstcheck",
"*/.tox/*/lib/python*/site-packages/rstcheck",
"*/.tox/pypy*/site-packages/rstcheck",
"*/.tox\\*\\Lib\\site-packages\\rstcheck",
]
local_combine = [
"src/rstcheck",
"*/.venv/lib/python*/site-packages/rstcheck",
"*/.venv\\*\\Lib\\site-packages\\rstcheck",
"*/src/rstcheck",
"*\\src\\rstcheck",
]
[tool.coverage.report]
show_missing = true
exclude_lines = [
"# pragma: no cover",
"if __name__ == ['\"]__main__['\"]:",
"def __str__",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"if 0:",
"if False:",
"if TYPE_CHECKING:",
"if MYPY:",
]
[tool.coverage.html]
show_contexts = true
[tool.coverage.coverage_conditional_plugin.rules]
# use with: # pragma: <KEY>
py-gte-310 = "sys_version_info >= (3, 10)"