Describe the bug
When a long f-string is wrapped / split due to exceeding the line limit, Black will never put a substitution at the end of a f-string, resulting in unexpected wrapping behaviour.
To Reproduce
Input:
print(
f"short {1} loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"
)
Output with --unstable:
print(
"short"
f" {1} loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"
)
Playground link
Expected behavior
print(
f"short {1}"
" loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"
)
Environment
Additional context
Adding any character after {1} results in the expected behaviour of the substitution being put in the first line.
Describe the bug
When a long f-string is wrapped / split due to exceeding the line limit, Black will never put a substitution at the end of a f-string, resulting in unexpected wrapping behaviour.
To Reproduce
Input:
Output with
--unstable:Playground link
Expected behavior
Environment
Additional context
Adding any character after
{1}results in the expected behaviour of the substitution being put in the first line.