Type completeness workflow#1042
Conversation
Pyright Type CompletenessView the full Project (full
Other symbols referenced but not exported by
Symbols without documentation:
Patch (exported symbols added or changed by this PR): no exported symbol type-completeness changes detected. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1042 +/- ##
=======================================
Coverage 89.35% 89.35%
=======================================
Files 89 89
Lines 5169 5169
Branches 661 661
=======================================
Hits 4619 4619
Misses 386 386
Partials 164 164
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b8cebdd. Configure here.
|
about a page and half down in the detailed report, I see the following. Are they invocations of numpy in our package? Or actual numpy source code that we are importing? If it's the latter, should we try to exclude? |
|
this also feels inflated to me: we may have a couple hundred no-docstring test functions, but I don't think we have more than couple dozen classes in the package in total, unless I'm misunderstanding 'class'. |
|
I also noticed it was high. It turns out the first time I tried this, it was including dependencies. I added The comment won't update until it gets merged though. Here are the updated stats when I ran it locally: Symbols exported by "chainladder": 1190
With known type: 148
With ambiguous type: 106
With unknown type: 936
(Ignoring unknown types imported from other packages)
Other symbols referenced but not exported by "chainladder": 13
With known type: 3
With ambiguous type: 1
With unknown type: 9
Symbols without documentation:
Functions without docstring: 310
Functions without default param: 0
Classes without docstring: 10
Type completeness score: 12.4% |
Good question. The report is so overwhelming, it's hard for me isolate and figure out, kind of like the pytest warnings. I think a large number of these will resolve as we improve the type coverage of the package. Then we can isolate and hunt down what's left over. For pytest, I asked Claude to pick the first test case that led to a warning, and resolved it. I'd use a similar technique for type errors. When we do, I think we should fix the things we can fix, but suppress the ones we can't do anything about, documenting the reason why. |
okay. i think that's fine. would you mind putting a disclaimer into our PR template that says something to the effect of, we'd appreciate if you add type hinting in your PR; but once you create the PR, the typing stats won't update. |

Summary of Changes
Add workflow for type completeness coverage report.
Runs
pyright --verifytypes chainladder --ignoreexternalto generate a type completeness coverage report. GitHub actions then uses this information to create a summary table and generates a comment on the PR.Related GitHub Issue(s)
#939
Additional Context for Reviewers
uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)Note
Low Risk
Changes are limited to new CI scripts and workflows; no application or library runtime behavior is modified.
Overview
Adds CI on every pull request that runs
pyright --verifytypeson thechainladderpackage at PR head and at the merge-basechainladdertree, then compares exported-symbol typing (known / ambiguous / unknown).A new
type_completeness.pyscript turns paired JSON reports into Markdown: project-wide completeness at head, docstring/default-param gaps, and a patch section for symbols whose export typing changed or were de-exported. A shell helper appends truncated full text output toGITHUB_STEP_SUMMARYso large reports do not blow the 1MiB cap.type_completeness.ymluploadssummary.mdand the PR number as an artifact;type_completeness_comment.ymlruns onworkflow_runsuccess and posts/updates a sticky PR comment via split permissions (read on the main job,pull-requests: writeon the comment job) so fork PRs stay safe.Reviewed by Cursor Bugbot for commit f4abd33. Bugbot is set up for automated code reviews on this repo. Configure here.