Debian Codegraph @

pyproject.toml

raw symbols SCIP
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"
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 "rstcheck-core >=1.1",
25 "typer >=0.12.0",
26 ]
27
28 [project.scripts]
29 rstcheck = "rstcheck._cli:main"
30
31 [project.optional-dependencies]
32 sphinx = ["sphinx >=5.0"]
33 toml = ["tomli >=2.0; python_version<='3.10'"]
34 testing = [
35 "pytest >=7.2",
36 "pytest-cov >=3.0",
37 "coverage[toml] >=6.0",
38 "coverage-conditional-plugin >=0.5",
39 "pytest-sugar >=0.9.5",
40 "pytest-randomly >=3.0",
41 ]
42 docs = [
43 "sphinx >=5.0",
44 "myst-parser >=3",
45 "sphinx-rtd-theme >=1.2",
46 "sphinxcontrib-spelling >=7.3",
47 "sphinx-click >=4.0.3",
48 "sphinx-autobuild >=2021.3.14",
49 ]
50 type-check = [
51 "mypy >=1.0",
52 ]
53 dev = [
54 "rstcheck[sphinx,toml,testing,docs,type-check]",
55 "tox >=3.15",
56 ]
57
58 [project.urls]
59 Documentation = "https://rstcheck.readthedocs.io/en/latest/"
60 Repository = "https://github.com/rstcheck/rstcheck"
61 Changelog = "https://github.com/rstcheck/rstcheck/blob/main/CHANGELOG.md"
62
63 [tool.setuptools_scm]
64 write_to = "src/rstcheck/__version__.py"
65
66
67 # -- MYPY CONFIG ----------------------------------------------------------------------
68 [tool.mypy]
69 python_version = "3.12"
70 follow_imports = "silent"
71 disallow_any_generics = true
72 disallow_subclassing_any = true
73 disallow_untyped_defs = true
74 check_untyped_defs = true
75 strict_optional = true
76 warn_redundant_casts = true
77 warn_unused_ignores = true
78 warn_return_any = true
79 warn_unreachable = true
80 implicit_reexport = false
81 show_error_context = true
82 show_column_numbers = true
83 plugins = ["pydantic.mypy"]
84 exclude = "\\.bak\\."
85
86 [tool.pydantic-mypy]
87 init_forbid_extra = true
88 init_typed = false
89 warn_required_dynamic_aliases = true
90
91
92 # -- RUFF CONFIG ----------------------------------------------------------------------
93 [tool.ruff]
94 target-version = "py312"
95 line-length = 100
96 output-format = "full"
97 show-fixes = true
98 extend-exclude = [
99 "*venv*/",
100 "*.bak.*",
101 ]
102 src = ["src", "tests"]
103
104 [tool.ruff.lint]
105 # MISSING
106 # flake8-aaa https://github.com/astral-sh/ruff/issues/3462
107 # flake8-broken-line https://github.com/astral-sh/ruff/issues/3465
108 # flake8-cognitive-complexity https://github.com/astral-sh/ruff/issues/2418 # max_cognitive_complexity = 10
109 # flake8-docstrings via pydocstyle?
110 # flake8-rst-docstrings = ">=0.2.5" # RST...
111 # flake8-sql https://github.com/sqlfluff/sqlfluff/
112 # flake8-typing-imports https://github.com/astral-sh/ruff/issues/2302
113 # flake8-use-fstring partial via UP031/UP032 https://github.com/astral-sh/ruff/issues/2097
114 # flake8-variables-names https://github.com/astral-sh/ruff/issues/3463
115 # flake8-walrus https://github.com/astral-sh/ruff/issues/3464
116 #########
117 select = [
118 "A", # flake8-builtins
119 "AIR", # Airflow
120 "ANN", # flake8-annotations
121 "ARG", # flake8-unused-arguments
122 "ASYNC", # flake8-async
123 "B", # flake8-bugbear
124 "BLE", # flake8-blind-except
125 "C4", # flake8-comprehensions
126 "C90", # mccabe
127 # "COM", # flake8-commas # black does that
128 # "CPY", # flake8-copyright # not needed
129 "D", # pydocstyle
130 "DJ", # flake8-django
131 "DTZ", # flake8-datetimez
132 "E", # pycodestyle
133 "EM", # flake8-errmsg
134 "ERA", # flake8-eradicate
135 "EXE", # flake8-executable
136 "F", # pyflakes
137 "FA", # flake8-future-annotations
138 "FBT", # flake8-boolean-trap
139 # "FIX", # flake8-fixme # custom pre-commit hook does with RegEx
140 "FLY", # flynt
141 "FURB", # refurb
142 "G", # flake8-logging-format
143 "I", # isort
144 "ICN", # flake8-import-conventions
145 "INP", # flake8-no-pep420
146 "INT", # flake8-gettext
147 "ISC", # flake8-implicit-str-concat
148 "LOG", # flake8-logging
149 "N", # pep8-naming
150 "NPY", # NumPy-specific rules
151 "PD", # flake8-vet
152 "PERF", # Perflint
153 "PGH", # pygrep-hooks
154 "PIE", # flake8-pie
155 "PLC", # Pylint - Convention
156 "PLE", # Pylint - Error
157 "PLR", # Pylint - Refactor
158 "PLW", # Pylint - Warning
159 "PT", # flake8-pytest-style
160 "PTH", # flake8-use-pathlib
161 "PYI", # flake8-pyi
162 "Q", # flake8-quotes
163 "RET", # flake8-return
164 "RSE", # flake8-raise
165 "RUF", # Ruff-specific rules
166 "S", # flake8-bandit
167 "SIM", # flake8-simplify
168 "SLF", # flake8-self
169 "SLOT", # flake8-slots
170 # "T10", # flake8-debugger # pre-commit hook does that
171 "T20", # flake8-print
172 "TCH", # flake8-type-checking
173 "TD", # flake8-todos
174 "TID", # flake8-tidy-imports
175 "TRY", # tryceratops
176 "UP", # pyupgrade
177 "W", # pycodestyle
178 "YTT", # flake8-2020
179 ]
180 ignore = [
181 # deactivate because unwanted
182 "ANN101", # type self
183 "ANN102", # type cls
184 "E501", # line length
185 "G00", # logging uses format strings
186 "PT011", # Use match for specific exceptions in pytest.raises
187 # Deactivated for ruff-fmt
188 "W191", # tab-indentation
189 "E111", # indentation-with-invalid-multiple
190 "E114", # indentation-with-invalid-multiple-comment
191 "E117", # over-indented
192 "D206", # indent-with-spaces
193 "D300", # triple-single-quotes
194 "TD001", # invalid-todo-tag
195 "TD002", # missing-todo-author
196 "TD003", # missing-todo-link
197 "Q000", # bad-quotes-inline-string
198 "Q001", # bad-quotes-multiline-string
199 "Q002", # bad-quotes-docstring
200 "Q003", # avoidable-escaped-quote
201 "COM812", # missing-trailing-comma
202 "COM819", # prohibited-trailing-comma
203 "PT011", # Use match for specific exceptions in pytest.raises
204 "ISC001", # single-line-implicit-string-concatenation
205 "ISC002", # multi-line-implicit-string-concatenation
206 ]
207 unfixable = ["ERA001"]
208
209 task-tags = ["TODO", "FIXME", "XXX", "NOTE", "BUG", "HACK", "CHANGE ME"]
210 # typing-modules = []
211
212 [tool.ruff.lint.per-file-ignores]
213 "**/tests/**" = [
214 "ARG", # unused arguments
215 "PLR0913", # Too many arguments to function call
216 "PLR2004", # Magic value comparison
217 "S101", # assert used
218 "SLF001", # Private member accessed
219 ]
220 "**/tests/**/*_test.py" = [
221 "FBT001", # Boolean positional arg in function definition
222 ]
223 "__init__.py" = [
224 "D104", # Missing docstring in public package
225 "PLC0414", # useless-import-alias
226 ]
227 "**/testing/examples/**" = [
228 "ERA001", # commented out code
229 ]
230 "docs/source/conf.py" = [
231 "INP001", # implicit namespace
232 ]
233 "__version__.py" = ["ALL"]
234
235 [tool.ruff.lint.flake8-annotations]
236 suppress-dummy-args = true
237
238 [tool.ruff.lint.flake8-bugbear]
239 extend-immutable-calls = [
240 "typer.Argument",
241 "typer.Option",
242 ]
243
244 [tool.ruff.lint.flake8-builtins]
245 builtins-ignorelist = [
246 "id",
247 ]
248
249 [tool.ruff.lint.flake8-import-conventions.extend-aliases]
250 "typing" = "t"
251
252 [tool.ruff.lint.flake8-pytest-style]
253 fixture-parentheses = false
254 mark-parentheses = false
255
256 [tool.ruff.lint.flake8-type-checking]
257 runtime-evaluated-base-classes = [
258 "pydantic.BaseModel",
259 ]
260
261 [tool.ruff.lint.isort]
262 combine-as-imports = true
263 known-first-party = []
264 known-third-party = []
265 required-imports = [
266 "from __future__ import annotations",
267 ]
268
269 [tool.ruff.lint.mccabe]
270 max-complexity = 20
271
272 [tool.ruff.lint.pep8-naming]
273 classmethod-decorators = [
274 "pydantic.field_validator",
275 "pydantic.model_validator",
276 ]
277 staticmethod-decorators = []
278
279 [tool.ruff.lint.pycodestyle]
280 ignore-overlong-task-comments = true
281 max-doc-length = 100
282
283 [tool.ruff.lint.pydocstyle]
284 convention = "pep257"
285 ignore-decorators = [
286 "typing.overload",
287 ]
288 property-decorators = []
289
290 [tool.ruff.lint.pylint]
291 max-args = 6
292
293
294 # -- PYTEST CONFIG --------------------------------------------------------------------
295 [tool.pytest.ini_options]
296 addopts = "-ra --showlocals"
297 mock_use_standalone_module = true
298 junit_family = "xunit2"
299 asyncio_mode = "strict"
300
301
302 # -- COVERAGE CONFIG ------------------------------------------------------------------
303 [tool.coverage]
304 [tool.coverage.run]
305 plugins = ["coverage_conditional_plugin"]
306 branch = true
307 parallel = true
308 context = "static-context"
309 omit = [
310 "tests/*",
311 ]
312
313 [tool.coverage.paths]
314 tox_combine = [
315 "src/rstcheck",
316 "*/.tox/*/lib/python*/site-packages/rstcheck",
317 "*/.tox/pypy*/site-packages/rstcheck",
318 "*/.tox\\*\\Lib\\site-packages\\rstcheck",
319 ]
320 local_combine = [
321 "src/rstcheck",
322 "*/.venv/lib/python*/site-packages/rstcheck",
323 "*/.venv\\*\\Lib\\site-packages\\rstcheck",
324 "*/src/rstcheck",
325 "*\\src\\rstcheck",
326 ]
327
328 [tool.coverage.report]
329 show_missing = true
330 exclude_lines = [
331 "# pragma: no cover",
332 "if __name__ == ['\"]__main__['\"]:",
333 "def __str__",
334 "def __repr__",
335 "if self.debug:",
336 "if settings.DEBUG",
337 "if 0:",
338 "if False:",
339 "if TYPE_CHECKING:",
340 "if typing.TYPE_CHECKING:",
341 "if MYPY:",
342 ]
343
344 [tool.coverage.html]
345 show_contexts = true
346
347 [tool.coverage.coverage_conditional_plugin.rules]
348 # use with: # pragma: <KEY>
349 py-gte-310 = "sys_version_info >= (3, 10)"