PyDocLint is a fast Python docstring linter that verifies whether a function's docstring sections (arguments, returns, yields, and raises) accurately match its signature and implementation. It currently supports NumPy, Google, and Sphinx docstring styles, running significantly faster than older alternatives. The library is actively maintained with frequent releases, and its current version is 0.8.3.
pip install pydoclintNo compatibility data collected yet for this library.
To get started, install pydoclint and run it as a command-line tool on your Python files or directories. Configuration can be managed via a `pyproject.toml` file or command-line arguments.
Upgrade Python to 3.10 or higher, or pin pydoclint to a version older than 0.7.4.
Review `pyproject.toml` or other config files against the official documentation to ensure correct syntax and options.
Upgrade pydoclint to the latest version (0.7.0 or newer) for comprehensive Google and Sphinx docstring style support.
Ensure type hints in docstrings precisely mirror those in function signatures. Adhere to standard Python naming conventions for methods and parameters.
Ensure that argument names, their order, and their presence in the docstring's argument section precisely reflect the function's signature. For NumPy style, ensure a space exists after the argument name and before the colon (e.g., `arg : type`). For Google style, ensure the 'Args:' section is preceded by a summary if one is used.
Add documentation for all missing arguments in the function's docstring to match the function signature.
Try reinstalling `pydoclint` and its dependencies to ensure compatible versions are used, or explicitly upgrade/downgrade `docstring-parser` to a version known to be compatible with your `pydoclint` version (e.g., `pip install --upgrade pydoclint` or `pip install docstring-parser==<compatible_version>`).
Ensure `pydoclint` is installed in your Python environment (`pip install pydoclint`). If it is, verify that the Python scripts directory (e.g., `Scripts` on Windows, `bin` on Linux/macOS within your virtual environment) is included in your system's PATH. Activating your virtual environment before running the command often resolves this.