string_processing: Long dictionary and f-string not formatted after breaking first line #3747
Labels
C: preview style
Issues with the preview and unstable style. Add the name of the responsible feature in the title.
F: strings
Related to our handling of strings
T: bug
Something isn't working
Describe the bug
Long strings and f-strings are not being formatted to line-width.
New strings created by black are not respecting line-width.
To Reproduce
For example, take this code for
variable a
:And run it against black with --preview:
The resulting output is:
Expected behavior
I expect the subsequent parts of the formatted string to also respect line-width or best fit
Environment
Macos Ventura 13.3.1
python -m black, 23.3.0 (compiled: yes)
Python (CPython) 3.11.3
Additional context
I also tried it in the black online formatter:
https://black.vercel.app/?version=main&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AOJAdRdAD2IimZxl1N_WlOfrjrxSR7DDzvx2We1aheMjV5DGeP3u-eAGsSx8HeKvvAO8NY_fW7oqtVDitrobuxhblPs7o5pkfycKe7coiigf4mPPAZzzYFp-cMZRWORSB-Gj8tZzbtjzppAeLljuxNSZ0A5RCV0fU-HJTjsoJc7ia75Is2LS2Tu1KbNm3kdoOWZ1lmI1teQxlevW_ki5EgHQTsHjH1unxS2zduAZ5N-n4KaVIXZCXWG-ndFoavjycobm9g_LlocqxpUEXGgdEKQsg026FHiMDrO7fSRm5xXs-CF8p_jdgvDtFHTAnsqv_EuLkcWlTG0CI50eVgVRV5SAdQEXVCHrpFaikYcq0P50IlKVI_UJV9IfQrKXMLKBOyk-MCziU8OIm9236R2F9_AteAtJx_jbMwYrNEl2pw9T1qGB4xcpbIKEr7--8CJHm3fXIebb1pN5s1mT-xRzUdu1Y-zfzvJD8vZmTR-faR2GQPdmaJpQVm-G1vOgO34Do6ZW_PRCw4niJNPWjJ3sw63ZgUZviQuogsynfAlmDXGSiMsWO4aO5Syrus3KyOyb4vCpOabT4FSexTYJ49zMb4Il6QJ_WbdJ_9nA1Zm9BwUhd_T0u_otmz-YgATsBh3NAAHHwAB8AOKBwAAzvfMFrHEZ_sCAAAAAARZWg==
The text was updated successfully, but these errors were encountered: