Skip to content

Do not collapse multiline docstrings #9804

@Glyphack

Description

@Glyphack

This issue was brought up in the review.

The summary is currently we collapse multiline docstrings, which is not compatible with black:

For example:

class Test:
    
    """
    Black's `Preview.module_docstring_newlines`


    A code black to format
"""

Black formats this to

class Test:
    """
    Black's `Preview.module_docstring_newlines`


    A code black to format
    """

and Ruff formats it to

class Test:
    """
    Black's `Preview.module_docstring_newlines`


    A code black to format"""

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingformatterRelated to the formatter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions