Refactor Choices class init, fix inexact type coercion, quote-aware command splitting, and typo fixes#39
Merged
Conversation
…uoted, fix typos Agent-Logs-Url: https://github.com/NetApp/recline/sessions/bda7b8f0-6028-489a-a229-ac1788166c6e Co-authored-by: RobertBlackhart <5414318+RobertBlackhart@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor class attribute setting to improve code clarity
Refactor Choices class init, fix inexact type coercion, quote-aware command splitting, and typo fixes
Apr 14, 2026
RobertBlackhart
approved these changes
Apr 14, 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.
Several independent bugs and code quality issues in
choices.pyandshell.py.recline/arg_types/choices.pyRemove
__new__for class attribute setup:available_choicesandmetavarwere being set as class attributes inside__new__, which is unconventional. Replaced with explicit post-definition assignment after the inner_Choicesclass body.Fix
inexact=Trueskippingdata_typeconversion: Wheninexact=True, the validate method returned the raw string without applyingdata_type, causing inconsistent return types. Nowdata_type(arg)is always applied; only the choice membership check is skipped.recline/repl/shell.pyQuote-aware command splitting:
;,&&, and||were split withstr.split(), which breaks on operators inside quoted strings (e.g.echo "foo;bar"would produce two commands). Replaced with_split_unquoted(), a lightweight parser that respects single quotes, double quotes, and backslash escapes.Typo fixes:
staring→starting,convienent→convenient,applicatinos→applications.Original prompt