{"id":6791,"library":"pydoclint","title":"PyDocLint","description":"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.","status":"active","version":"0.8.3","language":"python","source_language":"en","source_url":"https://github.com/jsh9/pydoclint","tags":["linter","docstrings","code quality","flake8"],"install":[{"cmd":"pip install pydoclint","lang":"bash","label":"Install native CLI"},{"cmd":"pip install pydoclint[flake8]","lang":"bash","label":"Install as Flake8 plugin"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false},{"reason":"Required if using pydoclint as a Flake8 plugin.","package":"flake8","optional":true}],"imports":[],"quickstart":{"code":"# my_module.py\ndef my_function(arg1: int, arg2: str) -> None:\n    \"\"\"\n    A sample function.\n\n    Parameters\n    ----------\n    arg1 : int\n        The first argument.\n    arg2 : str\n        The second argument.\n    \"\"\"\n    print(f'{arg1}, {arg2}')\n\n# pyproject.toml\n[tool.pydoclint]\nstyle = \"numpy\"\ncheck-arg-order = true\n\n# Terminal\n# Run pydoclint on a file or folder\npydoclint my_module.py\n# Or with a config file\npydoclint --config=pyproject.toml my_module.py\n# Or as a pre-commit hook (add to .pre-commit-config.yaml)\n# - repo: https://github.com/jsh9/pydoclint\n#   rev: <latest_tag> # e.g., 0.8.3\n#   hooks:\n#     - id: pydoclint\n#       args: [\"--config=pyproject.toml\"]","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade Python to 3.10 or higher, or pin pydoclint to a version older than 0.7.4.","message":"Python 3.9 support was dropped in version 0.7.4. Users on older Python versions will need to upgrade their Python environment to at least 3.10 to use pydoclint 0.7.4 and newer.","severity":"breaking","affected_versions":">=0.7.4"},{"fix":"Review `pyproject.toml` or other config files against the official documentation to ensure correct syntax and options.","message":"Configuration file validation was enhanced in version 0.7.4. Previously, malformed `pyproject.toml` or other config files might have been silently ignored or partially applied. Now, invalid configurations might lead to errors.","severity":"gotcha","affected_versions":">=0.7.4"},{"fix":"Upgrade pydoclint to the latest version (0.7.0 or newer) for comprehensive Google and Sphinx docstring style support.","message":"Earlier versions (prior to approximately 0.7.0) primarily supported NumPy-style docstrings, with Google and Sphinx style support added later. Users expecting full support for Google or Sphinx styles should ensure they are on a recent version.","severity":"gotcha","affected_versions":"<0.7.0"},{"fix":"Ensure type hints in docstrings precisely mirror those in function signatures. Adhere to standard Python naming conventions for methods and parameters.","message":"PyDocLint performs static analysis and expects exact matches for type hints between docstrings and function signatures. It does not recognize conventions like 'int, optional' for `Optional[int]`, requiring verbatim matching. Also, non-standard Pythonic naming (e.g., renaming `classmethod`) might lead to unexpected linting results.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.8.3':56 'accur':22 'activ':46 'altern':42 'argument':17 'code':59 'current':29,53 'docstr':7,15,35,58 'fast':5 'faster':39 'flake8':61 'frequent':49 'function':13 'googl':32 'implement':27 'librari':44 'linter':8,57 'maintain':47 'match':23 'numpi':31 'older':41 'pydoclint':1,2 'python':6 'qualiti':60 'rais':21 'releas':50 'return':18 'run':37 'section':16 'signatur':25 'signific':38 'sphinx':34 'style':36 'support':30 'verifi':10 'version':54 'whether':11 'yield':19","created_at":"2026-04-15T18:43:08.183203+00:00","updated_at":"2026-04-16T18:25:18.573018+00:00","problems":[{"fix":"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.","cause":"This error occurs when the arguments listed in the function's docstring do not exactly match the arguments in the function's signature, or when there are subtle formatting issues (e.g., missing a space after an argument name and colon in NumPy style, or missing a preceding summary in Google style).","error":"DOC103: Docstring arguments are different from function arguments."},{"fix":"Add documentation for all missing arguments in the function's docstring to match the function signature.","cause":"This violation indicates that the function's docstring is missing documentation for one or more arguments present in the function's definition.","error":"DOC101: Docstring contains fewer arguments than in function signature."},{"fix":"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>`).","cause":"This Python import error typically arises from a version incompatibility or conflict with the `docstring-parser` library, which `pydoclint` depends on, usually after an upgrade.","error":"ImportError: cannot import name 'DocstringAttr' from 'docstring_parser.common'"},{"fix":"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.","cause":"This common operating system error means the `pydoclint` executable cannot be found in the system's PATH environment variable, usually because it was not installed correctly or the installation directory is not on the PATH.","error":"'pydoclint' is not recognized as an internal or external command"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"pydoclint","cli_version":"pydoclint, version 0.8.3","type":"library","homepage":null,"github":"https://github.com/jsh9/pydoclint","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pydoclint/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-15","next_check":"2026-07-14","install_tag":null}}