Debian Codegraph @

core/pyproject.toml

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 [build-system]
2 requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
3 build-backend = "setuptools.build_meta"
4
5 [project]
6 name = "rstcheck-core"
7 requires-python = ">=3.8"
8 authors = [
9 { name = "Steven Myint", email = "[email protected]" },
10 ]
11 maintainers = [
12 { name = "Christian Riedel", email = "[email protected]" },
13 ]
14 description = "Checks syntax of reStructuredText and code blocks nested within it"
15 readme = "README.rst"
16 license = { text = "MIT" }
17 classifiers = [
18 "Topic :: Software Development :: Quality Assurance",
19 ]
20 keywords = ["restructuredtext", "rst", "linter", "static-analysis"]
21 dynamic = ["version"]
22
23 dependencies = [
24 "docutils >=0.7",
25 "pydantic >=2",
26 ]
27
28 [project.optional-dependencies]
29 sphinx = ["sphinx >=5.0"]
30 toml = ["tomli >=2.0; python_version<='3.10'"]
31 yaml = ["pyyaml >= 6.0.0"]
32 testing = [
33 "pytest >=7.2",
34 "pytest-cov >=3.0",
35 "coverage[toml] >=6.0",
36 "coverage-conditional-plugin >=0.5",
37 "pytest-sugar >=0.9.5",
38 "pytest-randomly >=3.0",
39 "pytest-mock >=3.7",
40 ]
41 docs = [
42 "sphinx >=5.0, !=7.2.5",
43 "m2r2 >=0.3.2",
44 "sphinx-rtd-theme >=1.2",
45 "sphinx-autodoc-typehints >=1.15",
46 "sphinxcontrib-apidoc >=0.3",
47 "sphinxcontrib-spelling >=7.3",
48 "sphinx-autobuild >=2021.3.14",
49 ]
50 type-check = [
51 "mypy >=1.0",
52 "types-docutils >=0.18",
53 "types-PyYAML >=6.0.0",
54 ]
55 dev = [
56 "rstcheck-core[sphinx,toml,testing,docs,type-check,yaml]",
57 "tox >=3.15",
58 ]
59
60 [project.urls]
61 Documentation = "https://rstcheck-core.readthedocs.io/en/latest/"
62 Repository = "https://github.com/rstcheck/rstcheck-core"
63 Changelog = "https://github.com/rstcheck/rstcheck-core/blob/main/CHANGELOG.md"
64
65 [tool.setuptools_scm]
66 write_to = "src/rstcheck_core/__version__.py"
67
68
69 # -- BLACK CONFIG ---------------------------------------------------------------------
70 [tool.black]
71 line-length = 100
72 exclude = "venv/"
73 include = '\.pyi?$' # single quotes needed
74
75 # -- MYPY CONFIG ----------------------------------------------------------------------
76 [tool.mypy]
77 show_error_codes = true
78 strict_optional = true
79 warn_unused_ignores = true
80 warn_redundant_casts = true
81 warn_return_any = true
82 warn_unreachable = true
83 disallow_any_generics = true
84 check_untyped_defs = true
85 implicit_reexport = false
86 python_version = "3.11" # CHANGE ME
87 plugins = "pydantic.mypy"
88
89 [tool.pydantic-mypy]
90 init_forbid_extra = true
91 init_typed = false
92 warn_required_dynamic_aliases = true
93 warn_untyped_fields = true
94
95
96 # -- RUFF CONFIG ----------------------------------------------------------------------
97 [tool.ruff]
98 target-version = "py311"
99 line-length = 100
100 output-format = "grouped"
101 show-fixes = true
102 show-source = true
103 task-tags = ["TODO", "FIXME", "XXX", "NOTE", "BUG", "HACK", "CHANGE ME"]
104 extend-exclude = [
105 "*venv*/",
106 "*.bak.*",
107 ]
108 src = ["src", "tests"]
109
110 unfixable = ["ERA001"]
111
112 select = [
113 "A", # flake8-builtins
114 "AIR", # Airflow
115 "ANN", # flake8-annotations
116 "ARG", # flake8-unused-arguments
117 "ASYNC", # flake8-async
118 "B", # flake8-bugbear
119 "BLE", # flake8-blind-except
120 "C4", # flake8-comprehensions
121 "C90", # mccabe
122 # "COM", # flake8-commas # black does that
123 "D", # pydocstyle
124 "DJ", # flake8-django
125 "DTZ", # flake8-datetimez
126 "E", # pycodestyle
127 "EM", # flake8-errmsg
128 "ERA", # flake8-eradicate
129 "EXE", # flake8-executable
130 "F", # pyflakes
131 "FA", # flake8-future-annotations
132 "FBT", # flake8-boolean-trap
133 # "FIX", # flake8-fixme # custom pre-commit hook does with RegEx
134 "FLY", # flynt
135 "G", # flake8-logging-format
136 "I", # isort
137 "ICN", # flake8-import-conventions
138 "INP", # flake8-no-pep420
139 "INT", # flake8-gettext
140 "ISC", # flake8-implicit-str-concat
141 "N", # pep8-naming
142 "NPY", # NumPy-specific rules
143 "PD", # flake8-vet
144 "PERF", # Perflint
145 "PGH", # pygrep-hooks
146 "PIE", # flake8-pie
147 "PLC", # Pylint - Convention
148 "PLE", # Pylint - Error
149 "PLR", # Pylint - Refactor
150 "PLW", # Pylint - Warning
151 "PT", # flake8-pytest-style
152 "PTH", # flake8-use-pathlib
153 "PYI", # flake8-pyi
154 "Q", # flake8-quotes
155 "RET", # flake8-return
156 "RUF", # Ruff-specific rules
157 "RSE", # flake8-raise
158 "S", # flake8-bandit
159 "SLF", # flake8-self
160 "SLOT", # flake8-slots
161 "SIM", # flake8-simplify
162 # "T10", # flake8-debugger # pre-commit hook does that
163 "T20", # flake8-print
164 "TCH", # flake8-type-checking
165 # "TD", # flake8-todo
166 "TID", # flake8-tidy-imports
167 "TRY", # tryceratops
168 "UP", # pyupgrade
169 "W", # pycodestyle
170 "YTT", # flake8-2020
171 ]
172
173 ignore = [
174 # deactivate because unwanted
175 "ANN101", # type self
176 "ANN102", # type cls
177 "E501", # line length
178 "PT011", # Use match for specific exceptions in pytest.raises
179 ]
180
181 [tool.ruff.per-file-ignores]
182 "**/tests/**" = [
183 "ARG", # unused arguments
184 "PLR0913", # Too many arguments to function call
185 "PLR2004", # Magic value comparison
186 "S101", # assert used
187 "SLF001", # Private member accessed
188 ]
189 "**/tests/**/*_test.py" = [
190 "FBT001", # Boolean positional arg in function definition
191 ]
192 "__init__.py" = [
193 "D104", # Missing docstring in public package
194 "PLC0414", # useless-import-alias
195 ]
196 "**/testing/examples/**" = [
197 "ERA001", # commented out code
198 ]
199 "docs/source/conf.py" = [
200 "INP001", # implicit namespace
201 ]
202 "__version__.py" = ["ALL"]
203
204 [tool.ruff.flake8-annotations]
205 suppress-dummy-args = true
206
207 [tool.ruff.flake8-builtins]
208 builtins-ignorelist = [
209 "id",
210 ]
211
212 [tool.ruff.flake8-import-conventions.extend-aliases]
213 "typing" = "t"
214
215 [tool.ruff.flake8-pytest-style]
216 fixture-parentheses = false
217 mark-parentheses = false
218
219 [tool.ruff.flake8-type-checking]
220 runtime-evaluated-base-classes = [
221 "pydantic.BaseModel",
222 ]
223
224 [tool.ruff.isort]
225 combine-as-imports = true
226 required-imports = [
227 "from __future__ import annotations",
228 ]
229
230 [tool.ruff.mccabe]
231 max-complexity = 20
232
233 [tool.ruff.pep8-naming]
234 classmethod-decorators = [
235 "pydantic.field_validator",
236 ]
237 staticmethod-decorators = []
238
239 [tool.ruff.pycodestyle]
240 ignore-overlong-task-comments = true
241 max-doc-length = 100
242
243 [tool.ruff.pydocstyle]
244 convention = "pep257"
245 ignore-decorators = [
246 "typing.overload",
247 ]
248 property-decorators = []
249
250 [tool.ruff.pylint]
251 max-args = 6
252
253
254 # -- PYTEST CONFIG --------------------------------------------------------------------
255 [tool.pytest.ini_options]
256 addopts = "-ra --showlocals"
257
258
259 # -- COVERAGE CONFIG ------------------------------------------------------------------
260 [tool.coverage]
261 [tool.coverage.run]
262 plugins = ["coverage_conditional_plugin"]
263 branch = true
264 parallel = true
265 context = "static-context"
266 omit = [
267 "tests/*",
268 ]
269
270 [tool.coverage.paths]
271 tox_combine = [
272 "src/rstcheck_core",
273 "*/.tox/*/lib/python*/site-packages/rstcheck_core",
274 "*/.tox/pypy*/site-packages/rstcheck_core",
275 "*/.tox\\*\\Lib\\site-packages\\rstcheck_core",
276 ]
277 local_combine = [
278 "src/rstcheck_core",
279 "*/.venv/lib/python*/site-packages/rstcheck_core",
280 "*/.venv\\*\\Lib\\site-packages\\rstcheck_core",
281 "*/src/rstcheck_core",
282 "*\\src\\rstcheck_core",
283 ]
284
285 [tool.coverage.report]
286 show_missing = true
287 exclude_lines = [
288 "# pragma: no cover",
289 "if __name__ == ['\"]__main__['\"]:",
290 "def __str__",
291 "def __repr__",
292 "if self.debug:",
293 "if settings.DEBUG",
294 "if 0:",
295 "if False:",
296 "if TYPE_CHECKING:",
297 "if MYPY:",
298 ]
299
300 [tool.coverage.html]
301 show_contexts = true
302
303 [tool.coverage.coverage_conditional_plugin.rules]
304 # use with: # pragma: <KEY>
305 py-gte-310 = "sys_version_info >= (3, 10)"