Skip to content

string_processing: Multiline string concatenated to be over line length in function argument default value #3497

@felix-hilden

Description

@felix-hilden

Describe the bug
From #2188: When processing a multiline string in a function argument default value with --preview (ESP), it is concatenated even if it will exceed line length.

To Reproduce
Here's a playground link.

def open_file_from_long_file_path(
    file_path = (
        "some/really/long/file/path/because/it/has/filehash/as/part/of/path/"
        "460e96a3b663f41a8412527424278bc60eb208ec5be1f5943e5dff2fe428a2da/"
        "file.txt"
    ),
):
    pass

is formatted as

def open_file_from_long_file_path(
    file_path="some/really/long/file/path/because/it/has/filehash/as/part/of/path/460e96a3b663f41a8412527424278bc60eb208ec5be1f5943e5dff2fe428a2da/file.txt",
):
    pass

Expected behavior
A formatting that conforms to line length limits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: preview styleIssues with the preview and unstable style. Add the name of the responsible feature in the title.F: stringsRelated to our handling of stringsT: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions