sourcery
sourcery copied to clipboard
replace-interpolation-with-fstring for logging collides with pylint rule
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
Thanks for raising @piankma . I think ideally we'd suggest something like the optimisations here instead: https://github.com/sourcery-ai/sourcery/issues/276
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