Repository navigation
Replace remaining constant_subtype_answer flags and exact_key_set dispatch with polymorphism - #2240
Merged
Merged
Conversation
…patch with polymorphism Batch 32 NRA structural slop sweep: - PlanStatus / CompletedPlanStatus: delete constant .complete flag; own newly_complete(), style_qt_label(), and present_textual() polymorphically (src/toad/plan.py, src/toad/qt/plan_panel.py, src/toad/widgets/plan.py) - ToolCallStatus / CompletedToolCallStatus: own project_output() polymorphically instead of branching on .completed (src/toad/acp/status.py) - Settlement / Ready: delete constant .ready flag; own placed() polymorphically (src/toad/client/reader_position.py) - FilterState / ActiveFilter: delete constant .active flag; own request_older() and prepare_edges() polymorphically (src/toad/transcript_filter.py, src/toad/client/history_pager.py, src/toad/widgets/transcript_history.py) - CommitClaim / RetainedBlockClaim: own retiring(block) polymorphically instead of branching on .retires (src/toad/commit_claims.py, src/toad/transcript_publication.py) - CategorizedMount.mount: accept explicit before=None, after=None instead of **kwargs exact-key-set dispatch (src/toad/widgets/conversation.py) Drives NRA constant_subtype_answer from 6 to 1, exact_key_set to 0, total raw findings 443 -> 438.
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.
Batch 32 NRA structural slop sweep:
PlanStatus/CompletedPlanStatus: delete.complete, add polymorphicnewly_complete(),style_qt_label(), andpresent_textual()ToolCallStatus/CompletedToolCallStatus: polymorphicproject_output()Settlement/Ready: delete.ready, add polymorphicplaced()FilterState/ActiveFilter: delete.active, add polymorphicrequest_older()andprepare_edges()CommitClaim/RetainedBlockClaim: polymorphicretiring(block)CategorizedMount.mount: explicitbefore=None, after=Nonereplacing**kwargsexact-key-set checkVerified:
tools/qt_inherit_ratchet.py: 0/0/0/0/0tools/shadow_check.py: 0tools/guarded_imports.py: 0pytest tests/guards/ --ignore=tests/guards/test_client_imports_without_textual.py: 137 passedconstant_subtype_answer: 6 -> 1,exact_key_set: 1 -> 0)