Preserve alignment of inline comments #4651
Labels
F: comments
The syntactic kind. Not in the language grammar, always on our minds. Best bugs.
T: style
What do we want Blackened code to look like?
Describe the style change
If inline comments have been aligned, that has most likely been done for a reason and breaking the alignment is likely to make the code worse. As an example, we have this code in our project:
Examples in the current Black style
Currently the above example is formatted like this:
Desired style
I'd prefer the original formatting of comments to be preserved. Well, I would be fine if there would be just two spaces between the longest item and its comment instead of the current four.
Additional context
The situation changes if the code itself needs to be formatted or if inline comments are so long that they violate the max line length. Neither of these are true in our case and, in my opinion, the formatted code is clearly worse than the original.
The text was updated successfully, but these errors were encountered: