-
-
Notifications
You must be signed in to change notification settings - Fork 617
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
Prefer f-strings instead of str.format #2164
base: main
Are you sure you want to change the base?
Conversation
c76c46b
to
1e897a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if pyupgrade could've handled this.
@@ -429,9 +429,9 @@ def get_best_match(self, ireq: InstallRequirement) -> InstallRequirement: | |||
|
|||
# Format the best match | |||
log.debug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging is supposed to pass params through dedicated arguments, though. Instead of pre-rendering strings before passing them into logging..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly what my change does.
Previously a pre-rendered string was being passed (one using .format()
). Now dedicated arguments are passed.
Ruff's pyupgrade re-implementation does handle this. This PR and #2163 are groundwork for using ruff instead of flake8+pyupgrade, but can be merged independently. |
1e897a4
to
a6939e2
Compare
Not sure about th CI failures. Rebased onto latest |
No user facing changes.