-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add pyright
as a pre-commit
check
#2115
Conversation
@martinhoyer would you have an experience with Pyright? I would like to add it as a complement to mypy, especially when it's able to spot some issues mypy does not report (yet?). However, the pre-commit integration is not as simple. |
Never used it myself, but read the discussion about pre-commit hook on pyright github. Looks like the wrapper you're using is the way for the foreseeable future. They mention it in their docs as well. (as I'm sure you're already know) I wonder if we can tell pre-commit to re-use the mypy virtualenv, instead of creating new one with all those dependencies. |
Yep, I've read this one. The wrapper on its own would be fine, I dislike the duplication of requirements, but there seems to be no easy way around this issue :/
Maybe, I have no idea, but I will give it a try. On the other hand, mypy check is probably not installing any tmt dependencies, just Click and a pile of stubs. But yeah, we there would be some overlap, sharing might be nice. |
3498c3b
to
50da395
Compare
cea373b
to
1bc07d3
Compare
1bc07d3
to
e21b0c5
Compare
Ok, trying to get this one merged in its current state: duplication of requirements between WRT files to check, the check does nothing as of now. It's like the mypy introduction, does nothing, all files are ignored, and we'll be fixing files and modules as we go, making them pass both mypy and pyright checks. |
9a77eb5
to
17e0fd9
Compare
17e0fd9
to
4206306
Compare
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.
Looks good, just two typos and one question.
pyright
as a pre-commit
check
Another pair of eyes, pyright is a type check plus a bit more, and will inspect the code from slightly different point of view. As a result, it will report issues mypy cannot spot, or cannot spot *yet* because the set of implemented checks is simply different. The slow, gradual approach is the key here, like the one we know from mypy introduction, and slowly files and packages will get covered.
efcd6bf
to
3b58629
Compare
Another pair of eyes, pyright is a type check plus a bit more, and will inspect the code from slightyl different point of view. As a result, it will report issues mypy cannot spot, or cannot spot yet because the set of implemented checks is simply different.
The slow, gradual approach is the key here, like the one we know from mypy introduction, and slowly files and packages will get covered.