这是indexloc提供的服务,不要输入任何密码
Skip to content

Add a rule for no-trailing-blank-lines for docstrings #19564

@chazmo03

Description

@chazmo03

Summary

Trailing blank lines within multi-line docstrings should be flagged and removed. This already happens for single-line docstrings (thanks to unnecessary-multiline-docstring), so it seems sensible to do the same for multi-line docstrings as well.

See example:

def function() -> None:
    """This single-line docstring would be fixed to remove the trailing blank lines.


    """

def function() -> None:
    """This multi-line docstring would NOT be fixed to remove the trailing blank lines.

    So long as there was a second non-blank line.


    """

Metadata

Metadata

Assignees

No one assigned

    Labels

    docstringRelated to docstring linting or formattingneeds-decisionAwaiting a decision from a maintainerruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions