sphinx-lint
Check for stylistic and formal issues in .rst and .py files included in the documentation.
What it is and what it does
Sphinx Lint is a command-line linter for reStructuredText and Python documentation files, designed to find errors that Sphinx's own build process does not catch. It evolved from CPython's rstlint.py tool and focuses on stylistic and formal issues—malformed roles, unclosed directives, and similar problems—while deliberately avoiding duplication of checks that sphinx-build already performs. The tool runs line-by-line and is intended to be fast enough for editor integration and single-file checking.
The linter can be invoked directly on files or directories, integrated into pre-commit workflows, and configured to ignore specific paths. It aims for zero false positives, though it currently skips some rules within tables due to limitations in line-by-line parsing. Runtime dependencies are minimal (polib and regex), and it supports Python 3.10 through 3.14.
Use it for:
- Catch reStructuredText syntax errors during local editing before running a full Sphinx build.
- Enforce documentation style consistency across a project via pre-commit hooks.
- Validate documentation files in CI/CD pipelines without triggering a complete Sphinx build.
- Find role and directive issues that Sphinx's build process does not report.
- Lint individual .rst files during authoring without checking the entire documentation tree.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sphinx Lint checks reStructuredText and Python documentation files for stylistic and formal issues that Sphinx itself may not catch, running as a command-line linter or pre-commit hook.
Yes. Sphinx Lint is actively maintained, has no security vulnerabilities, low install friction, and a permissive license. It fills a genuine gap—catching documentation errors Sphinx misses—and is designed for both local and CI use. The line-by-line limitation in tables is a known constraint, not a hidden gotcha. Suitable for any project using reStructuredText documentation.
Install
sphinx-lint on PyPI
pip
pip install sphinx-lintuv
uv add sphinx-lintpoetry
poetry add sphinx-lintInstalling sphinx-lint
Before you install
Low friction: pure Python wheel with only two runtime dependencies (polib and regex). Actively maintained with recent releases; last commit 2026-07-06 and production-stable status.
License in practice
Licensed under PSF-2.0 (Python Software Foundation License Version 2), a permissive license derived from its origin in CPython's documentation tools—no restrictions on use or distribution.
Quickstart
pip install sphinx-lint
sphinx-lint file.rst
sphinx-lint docs/
Requires Python 3.10 or later; does not work with reStructuredText tables due to line-by-line processing.
Verify before relying
- Whether false positives have been eliminated in practice or remain common in real documentation projects.
- Performance characteristics on large documentation trees or whether editor integration is truly comfortable at scale.
- Coverage of all Sphinx-invisible errors or whether some categories remain undetected.
Package facts
| License | PSF-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — polib, regex |
| Maintenance | actively maintained — 268 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 811,563/month — #5,003 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sphinx_lint-1.0.2-py3-none-any.whl
Tags
More Sphinx packages
Parses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
sphinxcontrib-qthelpA Sphinx extension that converts documentation…
permissive · top 1,000 on PyPI
doc8doc8 is a style checker for reStructuredText…
permissive · top 5,000 on PyPI
doccmdRuns linters, formatters, and other…
permissive · top 15,000 on PyPI
docsigLints Python function and method signatures to…
permissive · top 15,000 on PyPI
docstrfmtAutomatically formats reStructuredText in files…
permissive · top 15,000 on PyPI
restructuredtext-lintLints reStructuredText documents for structural…
permissive · top 5,000 on PyPI
sphinxcontrib-shellcheckA Sphinx extension that automatically lints…
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
flake8-rst-docstringsA flake8 plugin that validates Python…
permissive · top 15,000 on PyPI
yamllintyamllint checks YAML files for syntax errors,…
copyleft · top 1,000 on PyPI