-
Notifications
You must be signed in to change notification settings - Fork 40
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 type hints #199
Comments
I think the first order of business is to add mypy to the pre-commit check so it runs on CI: Unless this has a way to filter by folder, we may have to do the entire repo at once in order for CI to pass. But if there is a way to filter this check by folder, it would be nice to break up the PRs. This is their official recommendation too: https://mypy.readthedocs.io/en/stable/existing_code.html#start-small I would recommend starting with a draft PR that applies this for one file, because I am interested in also seeing what it ends up looking like and how we have to modify the docstrings / docs generation so the docs look good with type annotations. |
There is a way to filter folders/ files/directories to exclude them from the mypy check. This can be done by enabling or using the https://mypy.readthedocs.io/en/stable/config_file.html I created a similar config file in the root dir and excluded the major directories in the repository from the mypy check. Now, I am able to run this file from the command-line interface like this:
This is running fine. Now, because we want to configure mypy with pre-commit, I tried to read the config file from the pre-commit hook in the form of an argument. As of now, it is not working. I am figuring this out.
|
I want to do this so badly! But if someone wants to help, I won't be mad.
MyPy is promising: https://mypy-lang.org/, which has pre-commit hooks at https://github.com/pre-commit/mirrors-mypy
Would like to see how this plays with the docs generation as well.
The text was updated successfully, but these errors were encountered: