-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
F: stringsRelated to our handling of stringsRelated to our handling of stringsT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?
Description
Describe the style change
It may be related to #1467, but it seems #1467 is fixed when trying on https://black.now.sh/ while this one still fail.
Currently, string split in multiple lines are merged together.
Input:
ValueError(
'Invalid input:\n'
f' * x={x}\n'
f' * y={y}\n'
f' * z={z}'
)
When the last character of the line is a \n
, the code formatting match how the string will be displayed:
Invalid input:
* x=12
* y=41
* z=0
Examples in the current Black style
Black merge all lines together, while keeping segments separated, which hurts readability:
ValueError("Invalid input:\n" f" * x={x}\n" f" * y={y}\n" f" * z={z}")
Desired style
Black shouldn't merge the lines together and keep the original formatting:
ValueError(
'Invalid input:\n'
f' * x={x}\n'
f' * y={y}\n'
f' * z={z}'
)
st-pasha, yukihiko-shinoda, VladyslavaSysenko, Conchylicultor, neildataprophet and 1 moresealor, neildataprophet and 15r10nk
Metadata
Metadata
Assignees
Labels
F: stringsRelated to our handling of stringsRelated to our handling of stringsT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?