Skip to content

Simplify dictate language parsing and hoist help command rank#168

Merged
alexkroman merged 5 commits into
mainfrom
claude/simplify-refactorings-pygcu1
Jun 14, 2026
Merged

Simplify dictate language parsing and hoist help command rank#168
alexkroman merged 5 commits into
mainfrom
claude/simplify-refactorings-pygcu1

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Reuse core split_csv in dictate's _languages instead of re-inlining the
CSV split-and-strip, and lift the help command-rank dict to a module
constant so _OrderedGroup.list_commands stops rebuilding it on every
--help/completion render.

claude added 5 commits June 14, 2026 15:48
Reuse core split_csv in dictate's _languages instead of re-inlining the
CSV split-and-strip, and lift the help command-rank dict to a module
constant so _OrderedGroup.list_commands stops rebuilding it on every
--help/completion render.
…ions

13 flag-heavy commands each wrapped their run_<cmd>(opts, state, *, json_mode)
body in a byte-identical 'lambda state, json_mode: run_<cmd>(opts, state,
json_mode=json_mode)' to fit run_command's (state, json_mode) callable. Add a
typed context.run_with_options(ctx, run_<cmd>, opts, json=...) adapter and route
all 13 through it, so the seam lives in one place. opts/state are positional-only
on the runner Protocol so a state-ignoring body can still name it _state.
…odes

stream and agent both ran validate_output_flags(...) immediately followed by
output.stream_output_modes(...) on the next line — the only two callers of
validate_output_flags. Pair them in streaming.session.resolve_output_modes so
the modes can't be resolved without first rejecting a contradictory -o/--json
combination, and both commands call one helper.
app/init_exec._install_step hand-built the same skipped/failed/installed report
rows that init/devserver.install_step (used by dev/share) already produces. Reuse
it and keep only the init-specific launch decision. run_init raises Exit(1) on any
failed step before reading will_launch, so the failed path no longer needs to
special-case the flag — which also drops a # pragma: no mutate.
ffmpeg (mediafile), cloudflared (tunnel), the deploy CLIs (deploy), and the
interactive picker's questionary (init_exec) each hand-constructed
CLIError(error_type="missing_dependency", exit_code=1, ...). Route all four
through a errors.missing_dependency() factory (mirrors auth_failure/
mutually_exclusive) so the error-type string can't drift across them.
@alexkroman alexkroman enabled auto-merge June 14, 2026 18:14
@alexkroman alexkroman added this pull request to the merge queue Jun 14, 2026
Merged via the queue into main with commit 13c02ef Jun 14, 2026
19 checks passed
@alexkroman alexkroman deleted the claude/simplify-refactorings-pygcu1 branch June 14, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants