How to remove trailing comma? #9350
-
Before applying the formatter
After applying the formatter
Is there a way to configure the ruff formatter to remove the trailing comma next to arg10? Maybe by passing an argument to
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The Ruff formatter tries to follow the Black code style, which adds a trailing comma. A configuration option has not been added to Ruff to change that behaviour (it would have to be a new feature). |
Beta Was this translation helpful? Give feedback.
-
Here's a reason a flag to suppress trailing commas might be useful: It turns
However, sadly trailing commas aren't legal JSON. |
Beta Was this translation helpful? Give feedback.
The Ruff formatter tries to follow the Black code style, which adds a trailing comma. A configuration option has not been added to Ruff to change that behaviour (it would have to be a new feature).