ikamensh / flynt

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

transform-joins breaks code #188

Closed zeevro closed 1 year ago

zeevro commented 1 year ago

Here's my flynt output:

Running flynt v.1.0.0
Using config file at /asdf/qwer/pyproject.toml
Using following options: Namespace(verbose=True, quiet=False, no_multiline=False, line_length=88, dry_run=True, stdout=False, string=False, transform_percent=True, transform_format=True, transform_concats=True, transform_joins=True, fail_on_change=False, aggressive=False, exclude=None, src=['.dev/bug.py'], version=False)
Running flynt in dry-run mode. No files will be changed.
--- /asdf/qwer/bug.py

+++

@@ -1,2 +1,2 @@

-';'.join(['a', 'b', 'c'])
+";\"\"\".join(['a', 'b', 'c"

fstringifying /asdf/qwer/bug.py...modified

Flynt run has finished. Stats:

Execution time:                            0.003s
Files checked:                             1
Files modified:                            1
Character count reduction:                 25 (96.15%)

Per expression type:
No old style (`%`) expressions attempted.
No `.format(...)` calls attempted.
No concatenations attempted.
Static string joins attempted:             1/1 (100.0%)
F-string expressions created:              1

_-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_.
Please run your tests before committing. Did flynt get a perfect conversion? give it a star at:
~ https://github.com/ikamensh/flynt ~
Thank you for using flynt. Upgrade more projects and recommend it to your colleagues!

Python version is 3.11.3

ikamensh commented 1 year ago

I could reproduce it, thanks for the bug report!