July 13, 2023
10:35 p.m.
Hey,
Is there a tool sort of analogous to coverage.py, but for automatically checking the percentage of functions and methods (and containers?) with type annotations in a large code base?
Yep, mypy :) https://mypy.readthedocs.io/en/stable/command_line.html#report-generation The cobertura XML report seems to be standard-compliant so you can e.g. use it with diff-cover to see how type annotation coverage changes with a commit: https://pypi.org/project/diff-cover/ Florian