Open
Description
I'm trying to use diff-cover with mypy to enforce any new code to have type annotations. Here's what I use (via tox):
mypy --cobertura-xml-report {envtmpdir} qutebrowser tests {posargs}
diff-cover --fail-under=100 --compare-branch={env:DIFF_BRANCH:origin/{env:GITHUB_BASE_REF:master}} {envtmpdir}/cobertura.xml
That does seem to work fine - however, due to #6076 (cc @mthuurne), it disables incremental mode (causing the runtime of mypy to go up from <1s to ~15s). Note that in my case I don't care about the XML report only containing changed files, because those are the only ones actually relevant for the annotation coverage diff - thus, I think it would be fine to enable the cache for this use-case.
I understand if this is a too specific case, though - I wonder if it'd make sense to have some "enforce annotations for any new code" functionality in mypy itself (perhaps via the incremental mode)?