Sphinx Lint

1.0.2 · active · verified Mon Apr 13

Sphinx Lint is a lightweight Python linter designed to check for stylistic and formal issues in `.rst` (reStructuredText) and `.py` (Python) files primarily used in Sphinx documentation. It complements other linters by focusing on Sphinx-specific field list conventions and semantic consistency checks. The current version is 1.0.2, and the library maintains an active release cadence with regular updates and improvements.

Warnings

Install

Quickstart

Sphinx Lint is primarily used as a command-line tool or integrated with pre-commit hooks. The most common setup involves adding it to your project's `.pre-commit-config.yaml` to ensure documentation quality before commits. For direct command-line usage, simply run `sphinx-lint` with paths to files or directories.

pip install sphinx-lint pre-commit
pre-commit install

# .pre-commit-config.yaml example
# In your project's root:
# git init
# pre-commit install
# vim .pre-commit-config.yaml
# Add the following content:
#
# repos:
#   - repo: https://github.com/sphinx-contrib/sphinx-lint
#     rev: v1.0.2 # Use the latest release tag
#     hooks:
#       - id: sphinx-lint
#         types: [rst, python]

# Command line usage
sphinx-lint
# Check a specific file
sphinx-lint docs/index.rst
# Check a directory
sphinx-lint docs
# Ignore a directory
sphinx-lint -i venv
# Show help
sphinx-lint -h

view raw JSON →