-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
reportUndefinedVariable is a sub category of reportGeneralTypingIssues. #3229
Comments
Yes, this is correct. The If you want to suppress particular (pyright-specific) diagnostic rules, you need to use |
My issue is only about the specific rule codes/names, I'd like it to still notify me there is a |
The check for an undefined variable is reported as part of the We have on occasion separated out some checks into their own diagnostic rule, but we do this only if there's a strong justification — accompanied by feedback from many users. I don't think there's a good justification for this one. We might reconsider in the future if we get sufficient feedback from other users. |
If you want to ignore only |
Ah right, that makes sense, I see there isn't much you can do short of adding a lot more error codes which is fair enough if you don't want to add them, thank you. |
Describe the bug
After updating some of my code with unsafe casts to the type checker with the new support for
# type: ignore
comments on a per-line basis #3143, I noticed that on lines with NameErrors reportGeneralTypingIssues was supressing any NameErrors I had on the line.To Reproduce
Expected behavior
The first
# type: ignore
comment should supress theNameError
, the second should not and the third should.VS Code extension or command-line
pyright --version
pyright 1.1.231
The text was updated successfully, but these errors were encountered: