flake8-rst-docstrings
Python docstring reStructuredText (RST) validator for flake8
What it is and what it does
This is a flake8 plugin that integrates reStructuredText validation into your code linting workflow. It parses docstrings in Python files and checks them for RST markup errors using the docutils library, reporting issues with codes like RST201–RST220 for warnings, RST301–RST308 for major errors, and RST401–RST499 for severe errors. It complements pydocstyle-based checks (which validate docstring presence and PEP 257 conventions) by focusing specifically on the markup quality of docstring content.
The plugin runs as part of flake8, automatically detecting RST violations and reporting them with line numbers. It maps docutils severity levels to flake8 codes, so you can selectively enable or ignore specific RST error categories. Configuration options let you register custom Sphinx directives and roles to avoid false positives in projects using Sphinx extensions.
Use it for:
- Enforce consistent reStructuredText formatting in docstrings across a project during CI/CD linting.
- Catch RST syntax errors (malformed tables, unclosed markup, undefined substitutions) before documentation generation.
- Validate docstrings in Sphinx-documented projects by configuring recognized directives and roles.
- Combine with flake8-docstrings to check both docstring presence (PEP 257) and RST markup validity.
- Detect inline markup errors like mismatched emphasis or literal block issues in docstring content.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A flake8 plugin that validates Python docstrings as reStructuredText markup, catching RST syntax errors and formatting issues in docstring content.
Yes. The plugin is actively maintained, has no known vulnerabilities, installs with low friction, and fills a specific gap: validating RST markup in docstrings. Install it if your project uses reStructuredText docstrings and you want to catch markup errors early. Pair it with flake8-docstrings for comprehensive docstring linting.
Install
flake8-rst-docstrings on PyPI
pip
pip install flake8-rst-docstringsuv
uv add flake8-rst-docstringspoetry
poetry add flake8-rst-docstringsInstalling flake8-rst-docstrings
Before you install
Low friction installation with three runtime dependencies (flake8, restructuredtext_lint, pygments). Actively maintained with a recent release in October 2025 and ongoing commits through August 2026.
License in practice
MIT licensed, permissive terms—you can use, modify, and distribute the package freely in commercial and private projects without restriction.
Quickstart
pip install flake8-rst-docstrings
flake8 example.py
# or to see only RST violations:
flake8 --select RST example.py
Requires Python 3.9 or later.
Verify before relying
- Whether false positives are common when using Sphinx extensions without explicit configuration.
- Performance impact on large codebases with many docstrings.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — flake8, restructuredtext_lint, pygments |
| Maintenance | actively maintained — 312 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 226,773/month — #9,196 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flake8_rst_docstrings-0.4.0-py3-none-any.whl
Keywords: strings, formatting, style, docstrings, reStructuredText
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
restructuredtext-lintLints reStructuredText documents for structural…
permissive · top 5,000 on PyPI
collective.checkdocsAdds distutils commands to validate and preview…
copyleft · top 15,000 on PyPI
flake8-docstringsIntegrates pydocstyle docstring checking into…
permissive · top 5,000 on PyPI
docstrfmtAutomatically formats reStructuredText in files…
permissive · top 15,000 on PyPI
sphinx-lintSphinx Lint checks reStructuredText and Python…
permissive · top 15,000 on PyPI
rstcheckValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
rstcheck-coreValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
pydoclintPydoclint is a Python docstring linter that…
permissive · top 5,000 on PyPI
docsigLints Python function and method signatures to…
permissive · top 15,000 on PyPI
flake8-isortIntegrates isort into flake8 linting, reporting…
copyleft · top 5,000 on PyPI