Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 782 Bytes

empty-docstring.md

File metadata and controls

37 lines (26 loc) · 782 Bytes

Pattern: Empty docstring

Issue: -

Description

Used when a module, function, class or method has an empty docstring. Provide content for docstring or remove empty docstring to resolve this issue.

Example of incorrect code:

def complex(real=0.0, imag=0.0):
    """"""
    if imag == 0.0 and real == 0.0:
        return complex_zero
    ...

Example of correct code:

def complex(real=0.0, imag=0.0):
    """Form a complex number.

    Keyword arguments:
    real -- the real part (default 0.0)
    imag -- the imaginary part (default 0.0)
    """
    if imag == 0.0 and real == 0.0:
        return complex_zero
    ...

Further Reading