Skip to content

refactor(cli): consolidate --no-verify deprecation into one path#2868

Open
max-sixty wants to merge 1 commit into
mainfrom
canonical-paths
Open

refactor(cli): consolidate --no-verify deprecation into one path#2868
max-sixty wants to merge 1 commit into
mainfrom
canonical-paths

Conversation

@max-sixty
Copy link
Copy Markdown
Owner

The deprecated --no-verify flag was declared as a clap arg five times — across SwitchArgs, RemoveArgs, CommitArgs, SquashArgs, and MergeArgs — under two field names, resolved through two helpers, with the deprecation-warning string hand-duplicated in two places.

This collapses the four bool-resolving commands (switch, remove, step commit, step squash) onto a single flattened HookFlags args struct with one resolve() method, and routes every --no-verify deprecation warning — merge's included — through one emitter, so the warning text exists in exactly one place.

wt merge keeps its own flags: its hooks flag is genuinely tri-state (Option<bool>, so config [merge] verify still applies) with a positive --verify override, which HookFlags's SetFalse/default-true shape cannot express. It shares only the warning emitter — forcing it into the struct would need a special case.

Behavior is unchanged: --no-verify still works as a deprecated alias and emits the same warning under the same conditions. One visible --help change, a direct consequence of the shared struct: --no-hooks for step commit/step squash moves under the Automation heading, matching where switch/remove/merge already place it. Doc mirrors regenerated.

This was written by Claude Code on behalf of Maximilian Roos

The deprecated `--no-verify` flag was declared as a clap arg five times
across SwitchArgs, RemoveArgs, CommitArgs, SquashArgs, and MergeArgs under
two field names, resolved through two helpers, with the deprecation warning
string hand-duplicated in `resolve_verify` and `handle_merge_command`.

Collapse the four bool-resolving commands (switch, remove, step commit,
step squash) onto a single flattened `HookFlags` args struct with one
`resolve()` method, and route every `--no-verify` deprecation warning —
including merge's — through one `warn_no_verify_deprecated` emitter, so the
warning text exists in exactly one place.

`wt merge` keeps its own three flags: its hooks flag is tri-state
(`Option<bool>`, so config `[merge] verify` can still apply) and it carries
a positive `--verify` override, which `HookFlags`'s `SetFalse`/default-true
shape cannot express. It now shares only the warning emitter.

Behavior is unchanged — `--no-verify` still works as a deprecated alias and
emits the same warning. The one visible `--help` change: `--no-hooks` for
`step commit`/`step squash` moves under the "Automation" heading, matching
where switch/remove/merge already place it (`HookFlags` carries the
heading); generated step.md mirrors regenerated to match.

Adds a `remove --no-verify` deprecation test alongside the existing switch
and merge coverage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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