[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 >=0.12.0", ] [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", "myst-parser >=3", "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" # -- 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 "TCH", # flake8-type-checking "TD", # flake8-todos "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 "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 "PT011", # Use match for specific exceptions in pytest.raises "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-bugbear] extend-immutable-calls = [ "typer.Argument", "typer.Option", ] [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" mock_use_standalone_module = true 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", "*/.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 typing.TYPE_CHECKING:", "if MYPY:", ] [tool.coverage.html] show_contexts = true [tool.coverage.coverage_conditional_plugin.rules] # use with: # pragma: py-gte-310 = "sys_version_info >= (3, 10)"