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
Note: Reading the docs, not sure if this a bug or style request
Describe the bug
Black oddly indents method calls on string after long multiline string. A very common python usecase it write a long mutliline
string and follow it with e.g. .replace("\n", " ").
To Reproduce
Steps to reproduce the behavior:
Take this file '...'
long_text="""Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it tomake a specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remainingessentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsumpassages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\""".replace("\n", " ")
Run Black on it with these arguments (line length 120)
See:
long_text="""Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it tomake a specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remainingessentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsumpassages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\""".replace(
"\n", " "
)
Expected behavior A clear and concise description of what you expected to happen.
long_text="""Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it tomake a specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remainingessentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsumpassages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\""".replace("\n", " ")
It gets even worse as we chain the calls e.g.
long_text="""Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it tomake a specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remainingessentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsumpassages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\""".replace(
"\n", " "
).replace(
"\t", " "
)
Environment (please complete the following information):
Version: 20.8b1
OS and Python version: [ Linux/Python 3.8.8]
Does this bug also happen on master? To answer this, you have two options:
Yes
Additional context Add any other context about the problem here.
I can get around this with:
long_text="""Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been theindustry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it tomake a specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remainingessentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsumpassages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"""long_text=long_text.replace("\n", " ").replace("\t", " ")
But it seems a bit odd just to satisfy the formatter. Is this expected based on the style?
The text was updated successfully, but these errors were encountered:
Note: Reading the docs, not sure if this a bug or style request
Describe the bug
Black oddly indents method calls on string after long multiline string. A very common python usecase it write a long mutliline
string and follow it with e.g.
.replace("\n", " ")
.To Reproduce
Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
It gets even worse as we chain the calls e.g.
Environment (please complete the following information):
Does this bug also happen on master? To answer this, you have two options:
Yes
Additional context Add any other context about the problem here.
I can get around this with:
But it seems a bit odd just to satisfy the formatter. Is this expected based on the style?
The text was updated successfully, but these errors were encountered: