-
Notifications
You must be signed in to change notification settings - Fork 303
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3242 +/- ##
==========================================
+ Coverage 73.52% 73.57% +0.05%
==========================================
Files 60 60
Lines 4570 4568 -2
Branches 583 582 -1
==========================================
+ Hits 3360 3361 +1
+ Misses 1083 1081 -2
+ Partials 127 126 -1 ☔ 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
G004 Logging statement uses f-string
FLY002 Consider f-string instead of string join
PERF403 Use a dictionary comprehension instead of a for-loop
PGH003 Use specific rule codes when ignoring type issues
PLE1205 Too many arguments for `logging` format string
RUF010 Use explicit conversion flag
RUF013 PEP 484 prohibits implicit `Optional`
RUF021 Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear
RUF100 Unused `noqa` directive
F841 Local variable is assigned to but never used
FURB192 Prefer `max` over `sorted()` to compute the maximum value in a sequence
RUF028 This suppression comment is invalid because it cannot be in an expression, pattern, argument list, or other non-statement
RUF039 First argument is not raw string
Changes proposed in this pull request
Documentation that should be reviewed