-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ask PRs to annotate tests #5694
Conversation
Unit Test Results 6 files 6 suites 56m 28s ⏱️ Results for commit e353086. |
@@ -1,7 +1,7 @@ | |||
<!-- Feel free to remove check-list items aren't relevant to your change --> | |||
|
|||
- [ ] Closes #xxxx | |||
- [ ] Tests added | |||
- [ ] Tests added, and functions annotated with `-> None:` |
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.
Let's discuss this more back in #5690, but I don't think I would understand what this means from the description here alone.
An alternative would be to use check_untyped_defs. However, this would be much more strict. (I tried that once but ran into mypy errors I could not fix, so I gave up.) |
Ah nice! That would be better. I guess we want it for new code — it would be the herculean effort to fix the old code, most of which doesn't imply a true problem. FWIW I think most of the false positives are when reassinging variables to different types; e.g. Is there a way of explaining the TODO in a way that's easy for new contributors to understand? That's probably the closest solution here |
As discussed on the call — can we get mypy coverage? |
Here are the docs: https://mypy.readthedocs.io/en/stable/command_line.html#report-generation |
Nice, thanks @dcherian . Is anyone familiar with coveralls / whether this can be added? Is it possible to have a rule like "new functions need to be typed", by looking at the diff? That requires storing the previous results. One other alternative is to do the work to get all the test files typed, and then enforce @mathause 's idea of |
pre-commit run --all-files
whats-new.rst
As discussed #5690 (comment)