-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpyproject.toml
343 lines (311 loc) · 8.99 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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
[build-system]
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[project]
name = "rstcheck-core"
requires-python = ">=3.8"
authors = [
{ name = "Steven Myint", email = "[email protected]" },
]
maintainers = [
{ name = "Christian Riedel", email = "[email protected]" },
]
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 = [
"docutils >=0.7",
"pydantic >=2",
"importlib-metadata >=1.6; python_version<='3.8'",
"typing-extensions >=3.7.4; python_version<='3.8'",
]
[project.optional-dependencies]
sphinx = ["sphinx >=5.0"]
toml = ["tomli >=2.0; python_version<='3.10'"]
yaml = ["pyyaml >= 6.0.0"]
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",
"pytest-mock >=3.7",
]
docs = [
"sphinx >=5.0, !=7.2.5",
"myst-parser >=3",
"sphinx-rtd-theme >=1.2",
"sphinx-autodoc-typehints >=1.15",
"sphinxcontrib-apidoc >=0.3",
"sphinxcontrib-spelling >=7.3",
"sphinx-autobuild >=2021.3.14",
]
type-check = [
"mypy >=1.0",
"types-docutils >=0.18",
"types-PyYAML >=6.0.0",
]
dev = [
"rstcheck-core[sphinx,toml,testing,docs,type-check,yaml]",
"tox >=3.15",
]
[project.urls]
Documentation = "https://rstcheck-core.readthedocs.io/en/latest/"
Repository = "https://github.com/rstcheck/rstcheck-core"
Changelog = "https://github.com/rstcheck/rstcheck-core/blob/main/CHANGELOG.md"
[tool.setuptools_scm]
write_to = "src/rstcheck_core/__version__.py"
# -- MYPY CONFIG ----------------------------------------------------------------------
[tool.mypy]
python_version = "3.12"
follow_imports = "silent"
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_defs = true
check_untyped_defs = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
implicit_reexport = false
show_error_context = true
show_column_numbers = true
plugins = ["pydantic.mypy"]
exclude = "\\.bak\\."
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = false
warn_required_dynamic_aliases = true
# -- RUFF CONFIG ----------------------------------------------------------------------
[tool.ruff]
target-version = "py312"
line-length = 100
output-format = "full"
show-fixes = true
extend-exclude = [
"*venv*/",
"*.bak.*",
]
src = ["src", "tests"]
[tool.ruff.lint]
# MISSING
# flake8-aaa https://github.com/astral-sh/ruff/issues/3462
# flake8-broken-line https://github.com/astral-sh/ruff/issues/3465
# flake8-cognitive-complexity https://github.com/astral-sh/ruff/issues/2418 # max_cognitive_complexity = 10
# flake8-docstrings via pydocstyle?
# flake8-rst-docstrings = ">=0.2.5" # RST...
# flake8-sql https://github.com/sqlfluff/sqlfluff/
# flake8-typing-imports https://github.com/astral-sh/ruff/issues/2302
# flake8-use-fstring partial via UP031/UP032 https://github.com/astral-sh/ruff/issues/2097
# flake8-variables-names https://github.com/astral-sh/ruff/issues/3463
# flake8-walrus https://github.com/astral-sh/ruff/issues/3464
#########
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
# "CPY", # flake8-copyright # not needed
"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
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"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
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
# "T10", # flake8-debugger # pre-commit hook does that
"T20", # flake8-print
"TC", # flake8-type-checking
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
# deactivate because unwanted
"E501", # line length
"G00", # logging uses format strings
"PT011", # Use match for specific exceptions in pytest.raises
# Deactivated for ruff-fmt
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"TD001", # invalid-todo-tag
"TD002", # missing-todo-author
"TD003", # missing-todo-link
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
]
unfixable = ["ERA001"]
task-tags = ["TODO", "FIXME", "XXX", "NOTE", "BUG", "HACK", "CHANGE ME"]
# typing-modules = []
[tool.ruff.lint.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.lint.flake8-annotations]
suppress-dummy-args = true
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = [
"id",
]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"typing" = "t"
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.flake8-type-checking]
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = []
known-third-party = []
required-imports = [
"from __future__ import annotations",
]
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"pydantic.field_validator",
"pydantic.model_validator",
]
staticmethod-decorators = []
[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true
max-doc-length = 100
[tool.ruff.lint.pydocstyle]
convention = "pep257"
ignore-decorators = [
"typing.overload",
]
property-decorators = []
[tool.ruff.lint.pylint]
max-args = 6
# -- PYTEST CONFIG --------------------------------------------------------------------
[tool.pytest.ini_options]
addopts = "-ra --showlocals"
junit_family = "xunit2"
asyncio_mode = "strict"
# -- 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_core",
"*/.tox/*/lib/python*/site-packages/rstcheck_core",
"*/.tox/pypy*/site-packages/rstcheck_core",
"*/.tox\\*\\Lib\\site-packages\\rstcheck_core",
]
local_combine = [
"src/rstcheck_core",
"*/.venv/lib/python*/site-packages/rstcheck_core",
"*/.venv\\*\\Lib\\site-packages\\rstcheck_core",
"*/src/rstcheck_core",
"*\\src\\rstcheck_core",
]
[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 typing.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)"