-
-
Notifications
You must be signed in to change notification settings - Fork 150
chore(pyright): #1171 return None when possible; disable reportUnknownLambdaType #1405
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
Conversation
pyrightconfig-strict.json
Outdated
"reportMissingModuleSource": true, | ||
"useLibraryCodeForTypes": false | ||
"useLibraryCodeForTypes": false, | ||
"reportPrivateUsage": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to keep reportPrivateUsage
in there. I think pyright is wrong for reporting them in stub files. Created an issue: microsoft/pyright#10992
From the test files, we will be able to fix this once pandas 3.0 is released, where there will be a pandas.api.typing.aliases
which will be the supported way for people to import instead of using pandas._typing
. One reason I introduced the aliases was to get around this particular warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added back in 7d3c152
/pyright_strict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Also added
-> None
to tests and other possible places pyright_strict
errors reduced from 3732 to 3682.
pyrightconfig-strict.json
Outdated
"reportMissingModuleSource": true, | ||
"useLibraryCodeForTypes": false | ||
"useLibraryCodeForTypes": false, | ||
"reportPrivateUsage": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added back in 7d3c152
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @cmp0xff . With respect to the python functions in .py
files returning None
, is there some test we can include for new PRs (in pre-commit, or in the type checkers) that would pick that up?
Hi @Dr-Irv, I used |
I'd rather be incremental in adding rules in |
We are very far from making all ANN rules work. Alternatively I can propose that we |
I'm fine with that. We already exclude some rules already. My goal in bringing this up is that in this PR, you changed test functions to return |
reportPrivateUsage
42. Can we disable this forever? Importing_PrivateObjects
is widely used in Pandas. We cannot remove them.reportUnknownLambdaType
: 50. Can we disable this forever? They are only in tests at places where one can insert a callable.reportUnknownArgumentType
: 118.reportUnknownVariableType
: 405.reportMissingTypeArgument
: 430.reportMissingParameterType
: 799.reportUnknownParameterType
: 1235.reportUnknownMemberType
: 1411.If one wants to investigate the errors individually, here's the JSON snippet that can be inserted to
pyrightconfig-strict.json
. Simply enable the specific categories of error of interest.