-
Notifications
You must be signed in to change notification settings - Fork 25
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 to docstrings module #46
Conversation
Codecov Report
@@ Coverage Diff @@
## main #46 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 315 317 +2
=========================================
+ Hits 315 317 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
@WhyNotHugo Thanks a lot for your contribution! 💪
Could you exclude the if TYPE_CHECKING:
from the code coverage report as described in nedbat/coveragepy#831? (Just in pyproject.toml
instead of .coveragerc
)
Updated. I've just realised that I've mis-measuring coverage in a bunch of project too, thanks for the pointer. |
738e8e4
to
79d21a9
Compare
Rebased with pre-commit hooks applied. |
- Add type hints - Ignore type checking lines in coverage report Co-authored-by: Timo Brembeck <github@timo.brembeck.email>
79d21a9
to
5ae6bbc
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.
Great, thanks! 👍
I had to add the line pragma: no cover
to the excluded lines as well, but now the coverage report looks good 👌
If you want to, you can also add type hints for the rest of the package 😁
Also, what do you think about including a tool like Mypy to check the types as part of the GitHub actions workflow?
Mypy would help make sure that type hints keep making sense. 👍 Right now
You might need to use: FIELD_DESCRIPTORS : tuple[Any,...] = (FileDescriptor, related_descriptors.ForwardManyToOneDescriptor) |
No description provided.