-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
F811 is not raised when it is needed #11828
Comments
Not clear why it's not being raised here, but it should be AFAICT. |
@charliermarsh I think the shadowed binding can also be an Assignment. At the moment, Ruff checks shadowed binding for class, function, import, from import. |
@charliermarsh I like using Ruff. I'd love to contribute to ruff and would like to work on this issue. Is it okay if I take this on? |
@ukyen8 Yeah, go for it. The code for this rule logic is at ruff/crates/ruff_linter/src/checkers/ast/analyze/deferred_scopes.rs Lines 190 to 309 in c53d55a
Don't hesitate to ask any questions if you're stuck either here or on Discord :) |
) ## Summary This PR updates `F811` rule to include assignment as possible shadowed binding. This will fix issue: #11828 . ## Test Plan Add a test file, F811_30.py, which includes a redefinition after an assignment and a verified snapshot file.
Fixed in #11961, forgot to close. |
Ruff does not raise F811 error when unused redefinition exists.
Keywords:
"F811", "redefinition"
Code snippet:
Command:
ruff check --config /path/to/config /path/to/python/file.py
ruff.toml:
ruff version:
ruff 0.4.8
The text was updated successfully, but these errors were encountered: