ikamensh / flynt

A tool to automatically convert old string literal formatting to f-strings
MIT License
685 stars 33 forks source link

Unintuitive transformation #179

Open twmr opened 1 year ago

twmr commented 1 year ago

First of all thx for this great tool! I've just noticed that it performs the following transformation

writer.write(CR + LF + "Goodbye" + CR + LF)
->
writer.write(f"{CR + LF}Goodbye{CR}{LF}")

which is correct but it is a bit inconsistent (why does it use {CR + LF} at the beginning but {CR}{LF} at the end?).

I would expect the following result

writer.write(f"{CR}{LF}Goodbye{CR}{LF}")