-
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
RUF027 false positive with reserved keywords, how to handle? #9908
Comments
Just a side note, we have updated all usages of |
As a precision, RUF027's heuristic detects when you try to use an existing symbols in brackets. my_value = 5
message = "I have {my_value} things"
print(message) But since Maybe RUF027 could respect https://docs.astral.sh/ruff/settings/#lint_flake8-builtins_builtins-ignorelist ? |
I think this is already fixed on It should be included in the next release! |
👍 I believe this will be fixed in the next release -- sorry about that! |
Hi,
I would like to ask how to handle the cases where the "variable" for interpolation is used in the constant or other variable beforehand, example below
I have tried to "hack" slightly by using:
UPDATE: this is happening only with reserved keywords like
id
orfilter
. If variable does not exist, then this error is not raised.Should it be somehow treated or handled? Or for this cases should we add
# noqa: RUF027
? Or maybe the good suggestion would be to rename the variable inside the string fromid
toobject_id
?ruff version: 0.2.1
The text was updated successfully, but these errors were encountered: