-
Notifications
You must be signed in to change notification settings - Fork 306
MNT: Add flake8-logging-format (G) rules to ruff #3242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3242 +/- ##
=======================================
Coverage 73.50% 73.50%
=======================================
Files 60 60
Lines 4582 4582
Branches 585 585
=======================================
Hits 3368 3368
Misses 1085 1085
Partials 129 129 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm not sure why we should care about this. |
The linter recommends that because that's what many programmers suggest: defer string interpolation to the log function so that string interpolation doesn't occur whenever the log function doesn't print at the current log level. So that would be a performance issue. The rationale is that the speed gain when deferring string interpolation with terse logging outwheighs the speed gain of f-strings with verbose logging. Other programmers don't agree. |
1e04537
to
26623f1
Compare
a7cdac8
to
7af53d2
Compare
919b764
to
2e8298d
Compare
We decided in #3515 to generally prefer f-strings. Thanks for the effort, but we won't be enabling this rule and I'm closing this. |
That's not really about- f-strings. Just to make sure, this is not about using logger.info("info: %s" % s) vs. logger.info(f"info: {s}") It's about logger.info("info: %s", s) |
Correct. |
Changes proposed in this pull request
Documentation that should be reviewed