flake8-docstrings

1.7.0 · active · verified Fri Apr 10

flake8-docstrings is an extension for the `flake8` linter that integrates `pydocstyle` to enforce PEP 257 docstring conventions and other common docstring styles. It allows developers to check for issues like missing docstrings, incorrect formatting, and adherence to specific style guides (e.g., Google, NumPy) directly within their `flake8` workflow. The current stable version is 1.7.0, and it maintains an active release cadence.

Warnings

Install

Quickstart

After installation, `flake8-docstrings` automatically integrates with `flake8`. You can run `flake8` as usual. To apply specific docstring conventions (like Google or NumPy style) or to ignore certain checks, configure `flake8` using a configuration file (e.g., `setup.cfg`, `.flake8`, `tox.ini`) under the `[flake8]` section, or via command-line arguments like `--docstring-convention`.

# my_module.py
def my_function(arg):
    """This is a missing docstring summary.

    :param arg: An argument.
    :return: None
    """
    pass

# Configure in setup.cfg, .flake8, or tox.ini
# [flake8]
# docstring-convention = google
# extend-ignore = D205,D212,D415 # Common ignores for Google style

# Run flake8 from your terminal
# $ flake8 my_module.py

view raw JSON →