Skip to content
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

reportUnnecessaryTypeIgnoreComment for only pyright-specific ignores #5652

Closed
twoertwein opened this issue Aug 5, 2023 · 1 comment
Closed
Labels
as designed Not a bug, working as intended enhancement request New feature or request

Comments

@twoertwein
Copy link

Is your feature request related to a problem? Please describe.
Similar to #4243 but when a project prefers using the pyright-ignore comments only when mypy doesn't need the general ignore comment, i.e., pyright uses both ignore comments. In that case, reportUnnecessaryTypeIgnoreComment will flag ignores needed by mypy.

Describe the solution you’d like
"reportUnnecessaryTypeIgnoreComment": "pyright" to flag only pyright-specific ignore comments, while pyright still uses the general ignores for all other rules, i.e., "enableTypeIgnoreComments": true.

@twoertwein twoertwein added the enhancement request New feature or request label Aug 5, 2023
@erictraut
Copy link
Collaborator

All of the reportXXX configuration settings in pyright allow you to specify the diagnostic severity ("error", "warning", "information", or "none"). They also support true as an alias for "error" and false as an alias for "none". It wouldn't make sense to accept a value of "pyright" since that's not a valid diagnostic severity.

If you want pyright to ignore # type: ignore comments, you can use "enableTypeIgnoreComments": false. This works in conjunction with reportUnnecessaryTypeIgnoreComment as you would expect.

@erictraut erictraut added the as designed Not a bug, working as intended label Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as designed Not a bug, working as intended enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants