interrogate checks your Python codebase for missing docstrings. It aims to make documentation as important as code itself by highlighting methods, functions, classes, and modules that lack docstrings. This tool, currently at version 1.7.0, helps developers understand docstring coverage, enforce documentation in CI/CD pipelines, and assess code quality and maintainability. It supports Python 3.8 and above, with a moderate release cadence.
pip install interrogateVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a simple Python module and then run `interrogate` against it from the command line, showing basic usage, verbose output, and common options like ignoring `__init__` methods and setting a custom failure threshold.
Adjust the threshold using the `--fail-under` CLI option (e.g., `interrogate --fail-under 75 .`) or configure it in `pyproject.toml` or `setup.cfg`.
Use the `--ignore-init-method` CLI option (e.g., `interrogate --ignore-init-method .`) or configure `ignore_init_method = true` in your `pyproject.toml` or `setup.cfg` to exclude them.
Ensure `cairosvg` and its required system libraries are installed. Refer to `cairosvg` documentation for platform-specific installation instructions. If PNG badges are not critical, stick to the default SVG format.
For consistent project-wide settings, configure `interrogate` in `pyproject.toml` (recommended) or `setup.cfg`. Example: `[tool.interrogate] exclude = ["setup.py", "docs"] fail-under = 90 ignore-init-method = true`