-
Notifications
You must be signed in to change notification settings - Fork 202
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
Replace old %-formatted
by f-strings
#93
Conversation
@@ -70,3 +70,11 @@ repos: | |||
] | |||
additional_dependencies: | |||
- tomli==2.0.1 | |||
- repo: https://github.com/ikamensh/flynt |
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.
Instead of adding a new plugin, can you enable the check in Ruff? https://docs.astral.sh/ruff/rules/#flynt-fly
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.
Yes, I will check it.
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.
The implementation of Flynt in ruff is still in progress (astral-sh/ruff#2102), the current rule doesn't detect all the usages of the old styles, and I cannot provide the argument line-length
to deal with long lines. WDYT?
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.
Thanks, I was unaware of that. I ran it locally, and it didn't pick up the violations that are caught here.
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.
Great suggestion @hussein-awala 🙌
%-formatted
by f-strings
Replace old %-formatted by f-strings and add
flynt
hook to pre-commit to auto-detect and fix them.