-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Override --skipunannotated in file comment #4303
Comments
… corresponds to the `--skipunannotated` command-line option. Added an information diagnostic for skipped functions. This addresses #4303.
This is a reasonable feature request. When I initially added the |
Will there be (or is there already) a negative form of the command-line flag, i.e. |
No, there's no negative form. If you want pyright's default behavior, just omit the |
This is included in pyright 1.1.284, which I just published. It will also be included in a future release of pylance. |
Thank you for implementing this. I just tried it out, and it works, but now pyright's output on our codebase contains an enormous number of lines like this:
The standard way to suppress this would be to set the Is there any way to suppress these messages with |
If you have specialized needs for the output, you can wrap pyright with a small script that invokes it with |
Given that |
You commented on this feature request which has gathered some additional support since it was first posted. I think it's worth revisiting that feature request and adding a |
100% |
Is your feature request related to a problem? Please describe.
We are working to transition our CI from mypy to pyright. Mypy skips unannotated functions by default.
pyright
can skip unannotated functions if you pass the command line flag--skipunannotated
.Given the current state of the codebase, we're going to need to start off by running CI pyright in
--skipunannotated
mode in order to pass. We'd then like to opt individual files out of--skipunannotated
mode using# pyright:
comments at the top of the file.AFAICT, this is not currently possible. While pyright offers the ability to set the ruleset (
off
,basic
,strict
) and any configuration option listed here using a comment, there doesn't appear to be any option corresponding to the command line--skipunannotated
switch. Also, I tried using# pyright: basic
and that does not override--skipunannotated
either.I also grepped the pyright repo and found that
--skipunannotated
was setting ananalyzeUnannotatedFunctions
option. However,# pyright: analyzeUnannotatedFunctions=true
did not work to turn off--skipunannotated
for a file.Describe the solution you'd like
Provide a
# pyright:
setting you can put at the top of a file to turn off--skipunannotated
mode for that file.The text was updated successfully, but these errors were encountered: