-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[ruff
] Lint for implicit concatenation of t-strings and f-strings
#18396
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: main
Are you sure you want to change the base?
Conversation
I think we should wait with adding this rule until it's clear that it isn't a syntax error. We otherwise risk having a deprecated rule even before 3.14 is released |
That's fine with me! Just thought I'd knock it out before I forgot - happy to close/turn this to draft until then. |
|
I love the rule itself. Thanks for implementing it so quickly |
checker: &Checker, | ||
string_like: StringLike, | ||
) { | ||
if !checker.target_version().supports_t_strings() { |
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 don't see much harm to run the rule even if the target version doesn't support t strings
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 guess the issue is that the user would also see a version specific syntax error. But that's fine I guess?
I think the mkdocs test fails because it's testing the syntax of the docs using Python 3.13 |
As advertised!
Feel free to push back about the name, the decision to put this in the AST checker instead of working harder and putting it in the tokens checker, and anything else 😄