-
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
F821 Undefined name
code position incorrect in f-strings
#145
Comments
Yeah this looks like an issue in the parser -- the positions on the sub-expressions seem to be relative to the parent f-string. Thanks. |
(This is a blocker for 0.1.0.) |
#244 modifies the reporter to use the location of the start of the f-string. It's probably the best we can do without fixing this in the parse itself (which is a bit more involved). With this change, it'll at least be clear where you should put the noqa, and the location is a lot more reasonable (at the line on which the f-string starts, instead of at the top of the file). |
Thank you @charliermarsh ! This works and is the last piece missing to allow us to use ruff one of our projects ❤️ |
Np! If you hit any issues, don't hesitate to reach out! |
When trying to ignore F821 in some cases, like importing variables using star imports, I can't when the variable is used in an f-string. The line and column position seems to be off. Is that used to match the noqa comments?
The text was updated successfully, but these errors were encountered: