Skip to content

Inconsistent removal of trailing comma in single-argument functions #8912

@charliermarsh

Description

@charliermarsh

See: https://play.ruff.rs/96810c27-3971-44af-8eb5-5b5ebae1668e. We remove the trailing comma in the first case, but not in the second, when the trailing comment is present.

Note that this only happens with "skip-magic-trailing-comma": true. If you set "skip-magic-trailing-comma": false in the example above, we consistently insert the trailing comma.

Originally reported here: #1200 (comment).

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions