skillfed

doc8

Style checker for Sphinx (or other) RST documentation

doc8 v2.0.0 902.4K downloads/30d#4,770 on PyPI176
Permissive license Apache-2.0 Active released

What it is and what it does

doc8 is a command-line and programmatic style checker for reStructuredText documentation. It enforces a set of opinionated formatting rules including line length limits (default 79 characters), trailing whitespace removal, proper indentation without tabs, Unix newlines, and valid RST syntax. The tool can be run directly against documentation directories or integrated into Python projects via its API.

The package depends on docutils for RST parsing, restructuredtext-lint for linting checks, stevedore for plugin management, tomli for TOML configuration parsing, and Pygments for syntax highlighting. It supports configuration via command-line arguments or INI-style files (doc8.ini, setup.cfg, tox.ini, pyproject.toml) and allows selective error ignoring and path exclusion. Results are returned as structured error tuples or human-readable reports.

Use it for:

  • Enforce consistent RST formatting in Sphinx-based documentation projects as part of CI/CD pipelines.
  • Validate documentation style in multi-contributor projects to catch formatting issues before merge.
  • Check documentation compliance in automated quality gates alongside code linting tools.
  • Scan existing documentation repositories for style violations and generate reports for remediation.
  • Programmatically validate RST files in documentation generation workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

doc8 is a style checker for reStructuredText documentation that validates formatting rules like line length, trailing whitespace, indentation, and newline conventions.

Yes. doc8 is actively maintained, has no known vulnerabilities, installs with low friction, and is widely used (top 5000 PyPI packages). It fills a clear niche in RST documentation quality assurance. Install it if you maintain Sphinx or reStructuredText documentation and want automated style enforcement.

Install

doc8 on PyPI

pip

pip install doc8

uv

uv add doc8

poetry

poetry add doc8

Installing doc8

Before you install

Low install friction with a pure Python wheel distribution. Actively maintained with recent commits and a stable production status across Python 3.10 through 3.14.

License in practice

Apache-2.0 permissive license allows use in most projects, including commercial, with minimal restrictions beyond attribution.

Quickstart

pip install doc8

from doc8 import doc8

result = doc8(max_line_length=99)
print(result.report())

Requires Python 3.10 or later.

Verify before relying

  • Whether the package handles Markdown or other markup formats beyond RST and plain text.
  • Performance characteristics when scanning large documentation trees.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — docutils, restructuredtext-lint, stevedore, tomli, Pygments
Maintenance actively maintained — 427 days since the last release
Last repo commit
First released
Downloads 902,421/month — #4,770 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: doc8-2.0.0-py3-none-any.whl

Keywords: doc8, rst, linter

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: System :: Systems AdministrationTopic :: Utilities

Tags

rst linterdocumentation style checkerrestructuredtext format validationsphinx doc linterrst formatting rulesdoc8 style checkerdocumentation quality tool
documentation-lintingrst-validationci-cd-tool

More Utilities packages