This release includes the Beta version of the Ruff formatter — an extremely fast, Black-compatible Python formatter.
Try it today with ruff format.
Changes
Preview features
[pylint] Implement non-...
Yeah I get it that it’s one of -those- issues. I can live with the trailing comma at the end of a line, but a trailing comma on its own line triggers me badly, it tells my subconscious that “something is missing here”.
I understand the argument around diffs, but I spend way longer looking at code than I do diffs of code.
(Replying just for the chit chat - no criticism of opposite views implied)
For me it’s not even about the diffs, but like if you want to bulk edit the lines with a multi cursor, or copy and paste to add some new lines, it helps if they’re all uniform
I’m sorry you got downvoted, I totally get that trailing commas are ‘grammatically’ wrong and would look weird.
But I find these kind of common edits a bit of a pain in formats like JSON or SQL which don’t allow trailing comma. So I was happy to use a linter which enforces them, and then I got very used to them being there.
Ok I’ll ask it: does it have the option to not use magic commas?
Wow, I’m the opposite - trailing commas are a must
Yeah I get it that it’s one of -those- issues. I can live with the trailing comma at the end of a line, but a trailing comma on its own line triggers me badly, it tells my subconscious that “something is missing here”.
I understand the argument around diffs, but I spend way longer looking at code than I do diffs of code.
(Replying just for the chit chat - no criticism of opposite views implied)
For me it’s not even about the diffs, but like if you want to bulk edit the lines with a multi cursor, or copy and paste to add some new lines, it helps if they’re all uniform
I’d not really considered the copy and paste thing.
I’m sorry you got downvoted, I totally get that trailing commas are ‘grammatically’ wrong and would look weird.
But I find these kind of common edits a bit of a pain in formats like JSON or SQL which don’t allow trailing comma. So I was happy to use a linter which enforces them, and then I got very used to them being there.
Yes it does
I know some people love Black for its lack of configuration, but if Ruff adds a couple more config, then it’ll definitely be my go to formatter.
I’m not about to fuck up my entire projects formatting to match one persons opinion.
Hmm. It’s not clear that it won’t generate magic commas though, which is what I’m after. I guess I’ll just have to try it.
Trailing commas: