Skip to content

Add ratcheting type completeness check to CI - #799

Open
smheidrich wants to merge 1 commit into
python-rope:masterfrom
smheidrich:rel-gh-798-add-type-completeness-check-to-ci
Open

smheidrich wants to merge 1 commit into
python-rope:masterfrom
smheidrich:rel-gh-798-add-type-completeness-check-to-ci

Conversation

@smheidrich

@smheidrich smheidrich commented Sep 21, 2024 •

Copy link
Copy Markdown
Contributor

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

@mcepl

mcepl commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

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.

@mcepl
mcepl force-pushed the rel-gh-798-add-type-completeness-check-to-ci branch from 2b0a392 to 103beb2 Compare October 26, 2026 21:09
@mcepl
mcepl requested review from lieryan and mcepl October 26, 2026 21:09
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.34%. Comparing base (05b25ba) to head (103beb2).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mcepl
mcepl removed the request for review from lieryan October 26, 2026 21:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants