-
-
Notifications
You must be signed in to change notification settings - Fork 716
Add pyright for static type checking #17744
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
Can you clean up the other trailing spaces in requirements.txt by the way? |
@hwf1324 - this is probably better done as its own PR, it's relatively trivial |
Note: there's no inbuilt way of automatically generating |
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.
Mostly looks good, however I'm a little concerned about the inclusion of a bunch of internal classes in various modules' __all__
.
Co-authored-by: Sean Budd <[email protected]>
See test results for failed build of commit f2649a8e74 |
See test results for failed build of commit 445074b0b8 |
See test results for failed build of commit defc94e191 |
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 @seanbudd
Link to issue number:
Related to #17301
Summary of the issue:
NVDA has no type checking for python.
Python is a dynamically typed language meaning typing issues can occur at runtime.
Static analysers like
mypy
orpyright
can be used to avoid typing errors.Description of user facing changes
None
Description of development approach
pyright
was chosen overmypy
for performance reasons.Additionally, pyright has better pre-commit integration, and is built-in to VS Code, which is used by most NVDA developers.
We are far from compliant with static type checking, so most rules are currently disabled.
The intention is to fix compliance and turn on rules over time.
Various trivial typing fixes have occurred, particularly:
gettext
builtins and_buildVersion
generated build vars__all__
to mark export for private classesmatch
casesTesting strategy:
Known issues with pull request:
We are far from compliant with static type checking, so most rules are currently disabled.
The intention is to fix compliance and turn on rules over time.
Code Review Checklist:
@coderabbitai summary