rstcheck
Checks syntax of reStructuredText and code blocks nested within it
What it is and what it does
rstcheck is a linter and static analysis tool for reStructuredText documents that validates both RST syntax and the syntax of code blocks embedded within those documents. It checks code blocks written in Python, C, C++, Bash, Doctest, JSON, XML, and reStructuredText itself, reporting errors with line numbers and severity levels.
The tool is designed for documentation maintainers and developers who want to catch syntax errors in their RST files and embedded code examples before publishing. It integrates with pre-commit hooks for automated checking in CI/CD pipelines and supports optional configuration via pyproject.toml and Sphinx integration through installable extras.
Use it for:
- Validate syntax in code examples within Sphinx documentation before building and publishing.
- Catch Python syntax errors in doctest blocks and code-block directives in RST files.
- Enforce code quality in technical documentation by checking C, C++, and Bash snippets for correctness.
- Integrate into pre-commit hooks to prevent RST and code-block errors from being committed.
- Verify reStructuredText markup itself for structural issues like title underline mismatches.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Validates reStructuredText syntax and checks code blocks nested within RST documents for syntax errors across multiple languages including Python, C, C++, Bash, JSON, XML, and Doctest.
Yes. rstcheck is actively maintained, has low install friction, carries a permissive MIT license, and solves a specific problem well: catching syntax errors in RST documents and their embedded code blocks. It's a natural fit for documentation-heavy projects and CI/CD pipelines. No known vulnerabilities.
Install
rstcheck on PyPI
pip
pip install rstcheckuv
uv add rstcheckpoetry
poetry add rstcheckInstalling rstcheck
Before you install
Low friction installation with a pure Python wheel. Active maintenance with a release 17 days ago and consistent CI coverage. Requires Python 3.10 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial contexts with minimal restrictions.
Quickstart
pip install rstcheck
rstcheck myfile.rst
# Or with optional features:
pip install rstcheck[sphinx,toml]
Requires Python 3.10 or later.
Verify before relying
- Whether rstcheck-core and typer dependencies introduce any notable constraints or vulnerabilities beyond the main package.
- Performance characteristics when checking large documentation sets or deeply nested code blocks.
- Exact behavior and coverage of the supported language checkers (C99, C++11) and whether they require external tools.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — rstcheck-core, typer |
| Maintenance | actively maintained — 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,047,999/month — #4,448 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rstcheck-6.3.0-py3-none-any.whl
Keywords: restructuredtext, rst, linter, static-analysis
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
rstcheck-coreValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
restructuredtext-lintLints reStructuredText documents for structural…
permissive · top 5,000 on PyPI
sphinx-lintSphinx Lint checks reStructuredText and Python…
permissive · top 15,000 on PyPI
docstrfmtAutomatically formats reStructuredText in files…
permissive · top 15,000 on PyPI
doc8doc8 is a style checker for reStructuredText…
permissive · top 5,000 on PyPI
flake8-rst-docstringsA flake8 plugin that validates Python…
permissive · top 15,000 on PyPI
rich-rstRenders reStructuredText documents as Rich…
permissive · top 1,000 on PyPI
docsigLints Python function and method signatures to…
permissive · top 15,000 on PyPI
cpplintCpplint is a command-line static code checker…
permissive · top 15,000 on PyPI
code-annotationsParses and summarizes code annotations…
permissive · top 15,000 on PyPI