Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I resolve pydocstyle error "D205: 1 blank line required between summary line and description (found 0)"?

I'm trying to use pydocstyle to check the quality of my docstring and I'm getting this error:

D205: 1 blank line required between summary line and description (found 0)

This is how my code looks like

def func(input):
    """

    Function that does something interesting.
        Args:
            -input- Input of the function

    Returns:
        output- Output of the function

    """
    data = words + sentences
    corpus= somefunction(data)

When I put a blank line between the docstring and the function statements like so;

def func(input):
    """

    Function that does something interesting.
        Args:
            -input- Input of the function

    Returns:
        output- Output of the function

    """

    data = words + sentences
    corpus= somefunction(data)

I get the this errror:

D202: No blank lines allowed after function docstring (found 1)

How do I resolve this? Thanks for you help.

like image 639
Richard Ackon Avatar asked Jun 19 '18 09:06

Richard Ackon


1 Answers

See PEP 257 -- Docstring Conventions

def func(input):
    """**summary line** Function to do something interesting.

    **description starts after blank line above**
    Args:
        -input- Input of the function

    Returns:
        output- Output of the function

    """
    # no blank line allowed here

    data = [words, sentences]
    corpus = somefunction(data)
like image 144
ack Avatar answered Nov 01 '22 21:11

ack