-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Please consider having special error codes #3381
Comments
Pyright emits over 600 different error messages, and we're continually adding and tweaking these. Adding a separate error code for each one would be a big maintenance headache, and we don't have any current plans to do this. Pyright groups each of these error messages under about 60 different named "diagnostic rules". Each diagnostic is reported with its diagnostic rule. I recently added a mechanism that I think will address your needs. You can now add a If you see a legitimate false positive error generated by pyright, please file a bug so we can address it. |
Awesome! That completely satisfies my needs. I will just do that. |
@erictraut Is there a way to have pyright warn on unused |
|
Oh, but that triggers on all of the type ignores I added for mypy. Is there a way to report only for unnecessary |
No, If you want mypy-specific errors, you'll need to convince the mypy maintainers to implement that. The |
I know you're right. You're an idealist like me 😄 |
I use both MyPy and Pyright on the same project. In some rare instances, Pyright has a false positive where MyPy does not. I mark these with
# type: ignore[pyright]
.The problem is that when I call MyPy with
warn_unused_ignores = true
, I get things like:In my ideal world, Pyright would have its own error codes, and MyPy would know to ignore those when warning.
See python/mypy#12671 for the parallel MyPy issue, which is probably more important.
The text was updated successfully, but these errors were encountered: