Skip to content

[CHORE] Add trailing comma to multiline elements #1399

Description

@genedan

There are several places in the code where multiline elements do not have a trailing comma, e.g.,

my_list = [
    'a',
    'b',
    'c',
    'd
]

What Ruff format will do is put them all on the same line. The initial author who wrote the multiline code probably intended for it to stay that way and simply forgot the trailing comma, so we should add them, e.g.,

my_list = [
    'a',
    'b',
    'c',
    'd,
]

While rule COM812 enforces the comma, it interferes with the formatter, so shouldn't be used.

We'll need to use another tool. One can probably make quick work of this issue with an LLM.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Great First Contribution! 🌱Beginner friendly tickets with narrow scope and huge impact. Perfect to get your feet wet!

    Type

    Fields

    Priority

    High

    Effort

    Low

    Scope

    Both

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions