-
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
New rule request: Local variable might be referenced before assignment #6902
Comments
Makes sense. It's not trivial to fix because it requires supporting full branch analysis, but it would be good to catch of course. |
Yeah, seems really complicated, as does all this linter magic haha |
At least pycharm and possibly other IDEs static code analysis can catch this bug. I was also hoping to also find this rule in Ruff. |
SAME ISSUE FOR "Local variable might be referenced before assignment" |
https://github.com/google/pytype can work well for this @charliermarsh |
It would be awesome if Ruff could catch an error (like PyCharm does) for code like this:
The text was updated successfully, but these errors were encountered: