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.
pip install sphinx-lintNo compatibility data collected yet for this library.
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.
Upgrade your Python environment to 3.10 or a later supported version.
Review and update affected `.rst` and `.py` files to comply with the new linting rules for hyperlinks and roles.
Modify any scripts or automation that consume sphinx-lint's output to capture `stderr` for error reporting.
Be aware of potential false positives when linting files containing complex reStructuredText tables. If encountered, consider disabling specific checks locally or accepting the limitation.
Ensure your `.pre-commit-config.yaml` includes `require_serial: true` for the `sphinx-lint` hook to ensure reliable execution across environments.
Ensure `sphinx-lint` is installed in an environment whose script directory is in your system's PATH, or run it using `python -m sphinx_lint`.
Review and correct the syntax of your `.sphinx-lint.json` file to ensure it is valid JSON.
To ignore specific rules, use the `ignore` field in your `.sphinx-lint.json` configuration file, or add `# rst-lint: noqa` comments directly in your `.rst` files.
Ensure your `.pre-commit-config.yaml` correctly specifies the `sphinx-lint` hook (e.g., `repo: https://github.com/sphinx-contrib/sphinx-lint`, `id: sphinx-lint`, and a valid `rev`). Run `pre-commit autoupdate` and `pre-commit install` to refresh the hook environment.