sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

replace-with-f-string fooled by """multiline strings"""

Open ctwardy opened this issue 2 years ago • 0 comments

Checklist

  • [?] This is a new feature, not a refactoring suggestion
  • [x] I have checked for this feature in the Sourcery documentation
  • [x] I have checked there are no open requests referencing the same feature

Description

I love replace-with-f-string for cleaning old code. But today I was sad that it couldn't automatically fix some horrible multi-line sql concatenations.

Simple example:

It sees this:

temp = "yes we can: " + filename

It cannot see this:

  temp = """oh no
    a multiline string!""" + filename

ctwardy avatar Jan 20 '23 22:01 ctwardy