Skip to content

Formatter removes line break between implicitly concatenated strings #7052

@cnpryer

Description

@cnpryer

Couldn't find an exact issue, but I'm almost certain this has been reported already.

Maybe related to #6936
Also see #5893

Line-length: 88

Black (23.7.0):

print(
    "aaaaaaa {:.2f}% "
    "aaaaaaaaaaaaaaaa".format(
        (
            ((df_aaaaaaaaaaa["fak"].isna()) | (df_aaaaaaaaaaa["fak"] == 0)).sum()
            / len(df_aaaaaaaaaaa)
        )
        * 100
    )
)

Ruff (0.0.287):

print(
    "aaaaaaa {:.2f}% " "aaaaaaaaaaaaaaaa".format(
        (
            ((df_aaaaaaaaaaa["fak"].isna()) | (df_aaaaaaaaaaa["fak"] == 0)).sum()
            / len(df_aaaaaaaaaaa)
        )
        * 100
    )
)

Playground: https://play.ruff.rs/126e4315-3c75-4268-b43a-12586c5da779

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationformatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions