-
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
Support #noqa annotation #144
Comments
Pyright doesn't perform any linting (code style) checks, only type checks. There are already ways to provide additional type hints if needed. These include type annotations (including the "Any" type) and the cast function. So #noqa should not be necessary. If you have an example of an error that you are not sure how to resolve, let me know and I'll try to offer some guidance. |
@erictraut Here's an example: The from sklearn.base import BaseEstimator, ClassifierMixin It is entirely appropriate to both request that PyRight report missing type stubs, and explicitly disable said check in those cases where type stubs are not available. The current alternatives are both distasteful:
|
As mentioned above, pyright doesn't perform any lifting checks, only type checks. The " # noqa" comment is really meant for linters. Pyright does support "# type: none" comments to suppress errors or warnings on a particular line. You can also use "# pyright: reportMissingTypeStubs: false" to disable this diagnostic for a single file. Does that address your issue? |
@erictraut The Also, the example I provided (i.e. Basically, what would address my issue (as well as what I think @thpica was originally getting at), is a way to disable a particular message on a particular line. |
Here's the documentation for comment-based directives supported by pyright: |
Hi @erictraut ! I would like to add something to the debate and suggest maybe reconsidering adding I think it would make sense, when using a raw I know you are strongly against The only drawback I can think of is people who currently have |
Is your feature request related to a problem? Please describe.
There is no annotation to ignore linting errors on a line.
Describe the solution you'd like
Use the
#noqa
annotation to ignore linting errors on a line.The text was updated successfully, but these errors were encountered: