flake8-rst-docstrings is an MIT-licensed plugin for Flake8 that validates Python docstring markup as reStructuredText (RST). It leverages the `docutils` library and `restructuredtext-lint` internally to perform checks, ensuring that docstrings conform to RST syntax. The library is actively maintained, with its current version being 0.4.0, and development tracked on GitHub.
pip install flake8-rst-docstringsNo compatibility data collected yet for this library.
After installing, flake8-rst-docstrings automatically integrates with flake8. Simply run flake8 on your Python files. You can configure additional RST roles, directives, or ignore specific checks in your flake8 configuration file (e.g., .flake8, setup.cfg, pyproject.toml).
Upgrade to Python 3.8+ or use version 0.0.14 if Python 2.7 support is strictly necessary.
Add specific RST violation codes to your `flake8` configuration file's `extend-ignore` list (e.g., `extend-ignore = RST307`) to suppress these warnings.
Review the entire docstring section indicated by the warning, paying close attention to reStructuredText syntax within that block.
Configure your IDE's Python extension to prioritize the workspace-installed `flake8` by setting an option like `'flake8.importStrategy': 'fromEnvironment'` in your settings.json.
Correct the indentation in your docstring to adhere to reStructuredText syntax. Ensure consistent spacing and proper nesting for lists, blocks, etc.
If using Sphinx-specific directives, add them to your `flake8` configuration file using the `rst-directives` option (e.g., `rst-directives = envvar, exception, seealso`).
If using Sphinx-specific roles, add them to your `flake8` configuration file using the `rst-roles` option (e.g., `rst-roles = class, func, ref`).
Ensure all inline markup in your docstrings has matching start and end delimiters (e.g., `**strong**`, ``literal``, `*emphasis*`).