fix(types): make Provider/BumpStrategy protocol members read-only properties#52
Merged
Merged
Conversation
…perties ty 0.0.57 correctly rejects a ClassVar implementation of a mutable protocol instance attribute, so GitHubProvider/GitLabProvider (name) and the BumpStrategy impls (name/no_bump_status/no_bump_reason) failed 'checks / lint'. Declaring the protocol members as read-only @Property (which a ClassVar satisfies) fixes it. Structural-only: no runtime change; 473 tests pass at 100%, ty 0.0.57 clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The `checks / lint` job started failing on `ty` `invalid-return-type` errors in `ioc.py` after CI auto-resolved `ty` 0.0.57 (released 2026-07-08). Root cause: `Provider.name` and `BumpStrategy.{name,no_bump_status,no_bump_reason}` are declared as mutable protocol instance attributes, but the concrete impls declare them as `typing.ClassVar[str]` — which the newer `ty` correctly rejects as not satisfying a mutable protocol member.
Fix: declare those protocol members as read-only `@property` (satisfied by a `ClassVar`). Structural-only, no runtime change.
Verified: `uvx ty@latest` (0.0.57) clean, `just lint-ci` clean, 473 tests pass at 100% coverage. Also unblocks the docs PR #51.
🤖 Generated with Claude Code