skillfed

rstcheck

Checks syntax of reStructuredText and code blocks nested within it

rstcheck v6.3.0 1.0M downloads/30d#4,448 on PyPI256
Permissive license MIT Active released

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 rstcheck

uv

uv add rstcheck

poetry

poetry add rstcheck

Installing 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

Topic :: Software Development :: Quality Assurance

Tags

restructuredtext linterrst syntax checkercode block validationrst documentation linterstatic analysis rstnested code block checkerrst quality assurance
documentation-lintingstatic-analysispre-commit-hook

More Quality Assurance packages