terrencepreilly / darglint

A python documentation linter which checks that the docstring description matches the definition.
MIT License
481 stars 41 forks source link

Check capitalized #191

Closed LEv145 closed 2 years ago

LEv145 commented 2 years ago

Example of a function:

def foo(iter, index: int) -> int:
    """
    get page by key

    Args:
        iter: iterator
        index: start index

    Returns:
        len of iterator at index
    """

It would be convenient if the linter caused warnings:

def foo(iter, index: int) -> int:
    """
    get page by key  # Darglint: First line should end with a period
                     # Darglint: First line should be properly capitalized

    Args:
        iter: iterator  # Darglint: Args line should end with a period
                        # Darglint: Args line should be properly capitalized

        index: start index # Darglint: Args line should end with a period
                           # Darglint: Args line should be properly capitalized

    Returns:
        len of iterator at index  # Darglint: Returns line should end with a period
                                  # Darglint: Returns line should be properly capitalized
    """

I have not found such functionality

This maintains a uniform style, how here: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html

It would be possible to make an option for this

terrencepreilly commented 2 years ago

See the scope section of the readme. I think you're looking for a tool like pydocstyle.

LEv145 commented 2 years ago

Pycodestyle does not take this into account with google style, it would be useful to add this feature

You can make it optional, how mypy with strict mode