-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix RUF027 false positives if gettext
is imported using an alias
#12025
Conversation
crates/ruff_linter/src/rules/ruff/rules/missing_fstring_syntax.rs
Outdated
Show resolved
Hide resolved
|
What's exactly the false positive that this PR fixes? |
I think it's demonstrated in the fixture: aliasing |
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.
Nice find
crates/ruff_linter/src/rules/ruff/rules/missing_fstring_syntax.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/ruff/rules/missing_fstring_syntax.rs
Outdated
Show resolved
Hide resolved
The only risk here is: is |
We might want to also check the raw name. |
It's actually not currently; Micha made a good point -- there's a bug in my test :-) But I'll improve the test so that it does actually fail on |
Ah yeah, you're right, that's apparently a thing: https://github.com/django/django/blob/d9bd58c3b8b3e8735d8242c2bb9b09c52ed6171b/django/contrib/flatpages/forms.py#L5
|
I figured there was a reason for this (Chesterton's Fence) hah. |
Noticed this while reviewing if it was ready to be stabilised