Skip to content

docformatter removes blank line after last section in docstrings #43

@Andrew-Sheridan

Description

@Andrew-Sheridan

Issue Summary

If a docstring has a summary and a description that consists of at least one section, then there should be a blank line between the last line of the section and the the final """ of the docstring.

Example

Given the class SomeClass below, docformatter will remove the blank line at the end of the class dosctring, after the "Methods" section. In contrast, pydocstyle will throw a D413 error if that blank line is removed: D413: Missing blank line after last section ('Methods').

Is it possible to setup docformatter to respect D413?

class SomeClass:
    """Summary.

    Methods:
        method_1
        method_2
        method_3

    """

    def __init__(self):
        """Summary.

        Details about this thing that does nothing.
        """
        pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: styleRelates to docstring format style (e.g., Google, NumPy, Sphinx)P: enhancementFeature that is outside the scope of PEP 257U: lowA relatively low urgency issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions