feat: declare the attribute contracts the cancel and test mixins rely on - #68
Merged
Merged
Conversation
HasCancel and HasTest read self.page and self.resource, which the CustomAction they are mixed into supplies. AssociationMixin in the same file has carried the annotations describing that since ctrliq#50, and these two arrived in ctrliq#62 and ctrliq#65 without them, so the type checker reported seven unresolved attributes for a contract the file already knew how to state. Annotations rather than assignments, for the reason the comment on AssociationMixin gives: an assignment would create a class attribute that shadows the real one at runtime. Verified that neither name appears in vars() on either class, and that both land in __annotations__. ty goes from 35 diagnostics to 28. The one remaining in this file, the Launchable.add_arguments override on line 260, predates all of this.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cigamit
approved these changes
Sep 13, 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.
HasCancelandHasTestreadself.pageandself.resource, which theCustomActionthey are mixed into supplies.AssociationMixin, a few classes down the same file, has carried the annotations describing exactly that since #50 and #51. These two arrived in #62 and #65 without them, so the type checker reported seven unresolved attributes for a contract the file already knew how to state.Annotations rather than assignments, for the reason the comment on
AssociationMixinalready gives: an assignment would create a class attribute that shadows the real one at runtime.Verification
tygoes from 35 diagnostics to 28, which is the seven these two classes produced and nothing else. The one finding left in this file, theLaunchable.add_argumentsoverride on line 260, predates feat: add the cancel action to the CLI #62 and feat: add the test action to the CLI #65 and is not touched here.pagenorresourceappears invars()on either class, and both appear in__annotations__. That is the property the comment claims, checked rather than assumed.cancelentries and all threetestentries.ruff format --check,ruff checkand the unit suite (366 passing) are unchanged.Scope
This is the uncontroversial part of the follow-up #42 set up. The remaining 28 diagnostics are genuine annotation gaps in older code, each needing a small decision of its own: a
TypedDictfor the heterogeneous inventory structure inascender/inventory.py, theself.__class__(...)constructor calls inpages/page.py, and the override signatures inpages/notifications.pyandcli/custom.py:260. None of them is a runtime bug, checked individually. They are not in this pull request.