Skip to content

string_processing: duplicates comments when reformatting a multi-line call with comments in the middle #3665

@yilei

Description

@yilei

Describe the bug

The following code

a = b.c(
    d,  # comment
    ("e")
)

is formatted to:

a = b.c(d, "e")  # comment  # comment

with the comment duplicated.

Only happens in preview style, and the parentheses in ("e") are needed to reproduce. So this is likely something in removing these parentheses.

See playground.

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