Bug hazard - multiple strings given same indentation #4249
Labels
F: parentheses
Too many parentheses, not enough parentheses, and so on.
F: strings
Related to our handling of strings
T: style
What do we want Blackened code to look like?
Describe the style change
Strings that are concatenated together are always enclosed in parenthesis.
Examples in the current Black style
Desired style
Additional context
This isn't just a bug hazard where you accidentally join strings in an
*args
function. I frequently split strings that are too long by simply adding a""
at the split point and let black fix it. However, this doesn't format the way I want, so I have to spend time manually adding parenthesis around it.Also, both styles are currently accepted by black. I'm suggesting the first one should be rejected. I would be happy if there was an option to do this, and would be even happier if its already an option and I'm just not aware of it :)
In typical usage, the bug is harder to spot because the strings are often longer and the comma is all the way on the right-side of the editor. When you have mixed styles where some of the joins are intentional, its even harder to spot the bug.
The text was updated successfully, but these errors were encountered: