-
Notifications
You must be signed in to change notification settings - Fork 250
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
Run static typing checks #1222
Comments
I use On another note, I do like the benefit of type checkers but I don't want to be in a spot where we are spending more time fixing types than improving the product. I guess we have to try it before we know it. |
This is a very real concern. In my experience, MyPy in strict mode can be pretty picky and annoying. The good news is that these tools are usually highly configurable, it's a matter of finding the sweet spot. |
#1216 started adding some type hints to the codebase, as requested in #450. However, to my knowledge, we are not actually verifying if those hints are correct.
One of the possible type checkers is MyPy (Dropbox). It would be nice to add MyPy as part of pre-commit - however, as far as I understand, each hook runs in its own virtual environment, and therefore doesn't have the dependencies installed. This is problematic to run MyPy in "strict" mode, since one would have to
--ignore-imports
. There's more background here https://jaredkhan.com/blog/mypy-pre-commitAt some point I was using pytest-mypy, but I was hitting realpython/pytest-mypy#123 too often so now I default to running
mypy src tests
just beforepytest
.Other checkers:
I personally only have experience with MyPy.
The text was updated successfully, but these errors were encountered: