Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Formatter: multiline_string_handling preview style #8896

Copy link
Copy link
@MichaReiser

Description

@MichaReiser
Issue body actions

Implement Black's multiline_string_handling as a preview style.

Ruff already implements (as part of stable) the new style when calling functions on a multiline string:

MULTILINE = """
foobar
""".replace(
    "\n", ""
)

Get's formatted to

MULTILINE = """
foobar
""".replace("\n", "")

However, Ruff doesn't yet implement the new style when passing a multiline string in a function call:

textwrap.dedent(
    """\
    This is a
    multiline string
"""
)

Gets formatted to:

textwrap.dedent("""\
    This is a
    multiline string
""")

Note: It's not yet decided if this style will make it into Black's 2024 stable style

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterRelated to the formatterRelated to the formatterpreviewRelated to preview mode featuresRelated to preview mode features

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.