darglint

1.8.1 · maintenance · verified Sun Apr 12

Darglint is a functional docstring linter that checks whether a docstring's description matches the actual function or method implementation. It supports Google, Sphinx, and Numpy style docstrings, ensuring that parameters, returns, yields, and raises sections are consistent with the function signature and body. The project is currently in maintenance mode, with the author focusing on accepting pull requests rather than adding significant new features.

Warnings

Install

Quickstart

To quickly check a Python file with darglint, save your code to a .py file and run darglint directly from your terminal. It will output any docstring inconsistencies.

# my_module.py
def add_numbers(a: int, b: int) -> int:
    """Adds two numbers.

    Args:
        a: The first number.
        b: The second number.

    Returns:
        The sum of a and b.
    """
    return a + b

# To run: save the above as my_module.py, then execute in your terminal:
# darglint my_module.py

view raw JSON →