You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strings should remain on separate lines if they end with “\n”. The newline has already the meaning of a line-break in a string. I think it would improve the readability if black uses this information to format strings.
Examples in the current Black style
a="a=1\n""b=2\n""c=3\n"
Desired style
a= (
"a=1\n""b=2\n""c=3\n"
)
Additional context
I'm the author of inline-snapshot and I use currently multi-line strings to generate strings with newlines, but it is not possible for black to indent theses strings.
It would be nice if the strings can stay on separate lines if they end with newlines, or to have another way to generate multi-line strings which can be indented.
The text was updated successfully, but these errors were encountered:
Describe the style change
Strings should remain on separate lines if they end with “\n”. The newline has already the meaning of a line-break in a string. I think it would improve the readability if black uses this information to format strings.
Examples in the current Black style
Desired style
Additional context
I'm the author of inline-snapshot and I use currently multi-line strings to generate strings with newlines, but it is not possible for black to indent theses strings.
I would like to generate code like the following, but black merges the strings, which makes them hard to read.
> black
It would be nice if the strings can stay on separate lines if they end with newlines, or to have another way to generate multi-line strings which can be indented.
The text was updated successfully, but these errors were encountered: