-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Avoid consider-using-f-string
on modulos with brackets in template
#8720
Conversation
Brackets can be inconvenient in f-string expressions.
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 think it make sense, I'll wait for another opinion before merging.
hmm, what should I do about this failing test?
|
Hmm it seems #8109 is a regression tests about a crash and not about actually raising |
This comment has been minimized.
This comment has been minimized.
@progval do you think you'll be able to upgrade the tests to make the CI succeed ? :) |
Sorry, thanks for the reminder. Done now |
This comment has been minimized.
This comment has been minimized.
Thanks for the contribution! |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-maintenance/2.17.x maintenance/2.17.x
# Navigate to the new working tree
cd .worktrees/backport-maintenance/2.17.x
# Create a new branch
git switch --create backport-8720-to-maintenance/2.17.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ab77b988fe9352166faa2cb9126a5f2569403d98
# Push it to GitHub
git push --set-upstream origin backport-8720-to-maintenance/2.17.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-maintenance/2.17.x Then, create a pull request where the |
…ylint-dev#8720) Brackets can be inconvenient in f-string expressions.
Congratulation on becoming a pylint contributor, the primer result looks pretty good on this one, that's a lot of false positives avoided ! 💪 |
…ylint-dev#8720) Brackets can be inconvenient in f-string expressions.
…los with brackets in template … (#8836) * Avoid `consider-using-f-string` on modulos with brackets in template (#8720) Brackets can be inconvenient in f-string expressions. Co-authored-by: Val Lorentz <[email protected]> Co-authored-by: Pierre Sassoulas <[email protected]>
Type of Changes
Description
Brackets can be inconvenient in f-string expressions.
For example,
"{%s}%s" % (namespace, tag)
(idiomatic when using ElementTree) would bef"{{{namespace}}}{tag}"
as a f-string