sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

replace-interpolation-with-fstring for logging collides with pylint rule

Open piankma opened this issue 3 years ago • 2 comments

Checklist

  • [x] I have searched the Sourcery documentation for the issue, and found nothing
  • [x] I have checked there are no open bugs referencing the same bug or problem

Description

For the code below for logging i'm getting a suggestion: Replace interpolated string formatting with f-string (replace-interpolation-with-fstring) After accepting the fix, pylint disagrees with that, and reports "logging-fstring-interpolation"

Is aligning with pylint planned?

Code snippet that reproduces issue

        log.info("HTTP GET call : %s header=%s param=%s" % (self.url, header, content))

Debug Information

IDE Version: unrelated

Sourcery Version: 0.13.0

Operating system and Version: unrelated

piankma avatar Nov 23 '22 16:11 piankma

Thanks for raising @piankma . I think ideally we'd suggest something like the optimisations here instead: https://github.com/sourcery-ai/sourcery/issues/276

Hellebore avatar Nov 25 '22 17:11 Hellebore

Hi all,

Just wanted to flag that this is still popping up (e.g. https://github.com/ICRAR/daliuge/pull/254#discussion_r1606403669). Is there a way to disable particular forms of Sourcery suggestions? I can imagine this tripping up those not familiar with the distinctions between f-string and %strings for logging.

Warm Regards,

Ryan

myxie avatar May 21 '24 03:05 myxie