ENH: Continue work on type hinting, add pyright to check type coverage.#735
Merged
ENH: Continue work on type hinting, add pyright to check type coverage.#735
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #735 +/- ##
==========================================
+ Coverage 85.25% 85.94% +0.68%
==========================================
Files 85 85
Lines 4952 4924 -28
Branches 645 637 -8
==========================================
+ Hits 4222 4232 +10
+ Misses 521 491 -30
+ Partials 209 201 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
There are 4 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c5305b8. Configure here.
henrydingliu
reviewed
May 5, 2026
henrydingliu
previously approved these changes
May 5, 2026
henrydingliu
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary of Changes
Continues work on adding type hints. Also adds development dependency Pyright which is used to check the quality of the typing and provide a coverage report.
Fixes some formatting issues in docstring example in
triangle.py.Related GitHub Issue(s)
#486
Additional Context for Reviewers
Sets the Chainladder package in the virtual environment to editable mode via a setting in
pyproject.toml. This was required for Pyright to generate the coverage report.We're currently at 5.4%, so we have quite a ways to go until type completeness. We'll just keep chipping away at it.
Note
Medium Risk
Mostly typing/configuration work, but it tightens
Common._validate_assumptionto raiseTypeErrorfor unsupported inputs, which could surface new runtime errors in downstream code paths that previously fell through silently.Overview
Type checking support was added and packaging/test config updated. This introduces
pyrightconfig.json, addspyrightas a dev dependency (and updatesuv.lock), ships apy.typedmarker, and tweaks pytest discovery (testpaths). Coverage config now excludesif TYPE_CHECKING:blocks.Core typing work continues across
coreanddevelopment. Several modules addfrom __future__ import annotations,TYPE_CHECKINGimports, and richer type annotations forDevelopment/DevelopmentBasehelpers.Behavioral tightening:
Common._validate_assumptionis refactored into a typed@staticmethodwith explicitelifbranches and now raises a clearTypeErrorfor unsupportedvaluetypes; a new unit test asserts this. Docs: multipleTriangledocstring examples are reformatted into Sphinx.. testcode::/.. testoutput::blocks.Reviewed by Cursor Bugbot for commit 9358edd. Bugbot is set up for automated code reviews on this repo. Configure here.