Refactor net_cmd_ms validation into schema-based parsing#190
Closed
OmniTroid wants to merge 4 commits into
Closed
Conversation
Replace ~350 lines of repetitive if/elif validation code with a data-driven approach using schema definitions and a helper method. - Add _MS_BASE_FIELDS, _MS_26_FIELDS, _MS_28_FIELDS, _MS_DRO_FIELDS as class attributes defining field names and types for each protocol - Add _MS_SCHEMAS list to try schemas from most to least complete - Add _MS_DEFAULTS dict for optional field default values - Add _parse_ms_args() helper that validates against schemas and handles DRO ding normalization and pair_order extraction - Simplify net_cmd_ms() to use the new helper Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
|
Separated ms parsing into different file as this is 10x more complex than anything else. |
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.
Replace ~350 lines of repetitive if/elif validation code with a data-driven approach using schema definitions and a helper method.
DISCLAIMER: This was refactored by Claude Code. The end goal seems quite bounded and straightforward. Should be tested with the various clients/protocols it supports.