Repository navigation
Add ratcheting type completeness check to CI - #799
smheidrich wants to merge 1 commit into
Conversation
|
Before running or merging this workflow, we should agree on the type-completeness policy it would enforce. I would prefer to introduce this as a non-required check first. That would let us observe its behaviour on ordinary PRs before making it a merge requirement. Could you document how the action compares the PR with its base, what counts as a regression, and how maintainers would handle an intentional reduction? Please also explain the effect of creating rope/py.typed only for this check, since that differs from testing the package exactly as distributed. Please refresh the workflow, pin the third-party action to a reviewed commit SHA, declare minimal permissions, and provide example runs showing an unchanged score, an improvement, and a regression. We can then review both the policy and the workflow before deciding whether it should become required. |
2b0a392 to
103beb2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #799 +/- ##
=======================================
Coverage 95.34% 95.34%
=======================================
Files 134 134
Lines 26762 26762
=======================================
Hits 25516 25516
Misses 1246 1246 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Is this type-completeness check still something you want to pursue? If so, could you update the PR with the policy and workflow changes from my earlier comment, including a non-required trial, a pinned action SHA, and minimal permissions? If not, we can close this PR. |
|
Sorry for the late response; I'll probably not look into it again before Christmas, if someone else wants to add a similar check earlier then feel free to close this one; I wouldn't consider it rude or anything (obviously the same goes if you were to close it for another reason). |
|
Closing in favour of #971, which builds on the idea here using a self-contained |
Replace the earlier Pyright-based proposal with a lightweight mypy-based typing coverage check that avoids Node.js and third- party composite actions, pins mypy and all GitHub Actions by commit SHA, and runs directly against the package as distributed without fabricating a py.typed marker. The new bin/typing-coverage.py helper compares base and PR checkouts using mypy --lineprecision-report (primary metric: precise non-empty lines) and --linecount-report (secondary metric: annotated functions), enforcing a two-phase policy documented in docs/contributing.rst: - Below 50% precise-line coverage, the check is strictly informational and always passes. - At or above 50%, drops greater than 5 percentage points fail the check unless a maintainer applies the allow-typing-regression label. A separate workflow_run workflow posts and updates a single sticky HTML/Markdown summary comment on the pull request without checking out untrusted PR code. Refs: #798 Supersedes: #799
Replace the earlier Pyright-based proposal with a lightweight mypy-based typing coverage check that avoids Node.js and third- party composite actions, pins mypy and all GitHub Actions by commit SHA, and runs directly against the package as distributed without fabricating a py.typed marker. The new bin/typing-coverage.py helper compares base and PR checkouts using mypy --lineprecision-report (primary metric: precise non-empty lines) and --linecount-report (secondary metric: annotated functions), enforcing a two-phase policy documented in docs/contributing.rst: - Below 50% precise-line coverage, the check is strictly informational and always passes. - At or above 50%, drops greater than 5 percentage points fail the check unless a maintainer applies the allow-typing-regression label. A separate workflow_run workflow posts and updates a single sticky HTML/Markdown summary comment on the pull request without checking out untrusted PR code. Refs: #798 Supersedes: #799
Description
To help make progress in adding type hints for Rope's public API (#798), it might make sense to have a "ratcheting" mechanism in CI that prevents merging PRs which make the typing situation worse (by adding more untyped public functionality) and might motivate people to actively improve it by adding more type hints (although unfortunately the completeness score isn't visible directly on the PR page, which would probably help facilitate that).
This PR adds such a mechanism using the pyright-type-completeness GitHub Action.
You can see what it looks like in action here: smheidrich#1