refactor(cli): consolidate --no-verify deprecation into one path#2868
Merged
Conversation
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>
worktrunk-bot
approved these changes
May 21, 2026
max-sixty
added a commit
that referenced
this pull request
May 23, 2026
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_ Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
The deprecated
--no-verifyflag was declared as a clap arg five times — acrossSwitchArgs,RemoveArgs,CommitArgs,SquashArgs, andMergeArgs— 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 flattenedHookFlagsargs struct with oneresolve()method, and routes every--no-verifydeprecation warning — merge's included — through one emitter, so the warning text exists in exactly one place.wt mergekeeps its own flags: its hooks flag is genuinely tri-state (Option<bool>, so config[merge] verifystill applies) with a positive--verifyoverride, whichHookFlags'sSetFalse/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-verifystill works as a deprecated alias and emits the same warning under the same conditions. One visible--helpchange, a direct consequence of the shared struct:--no-hooksforstep commit/step squashmoves under theAutomationheading, matching whereswitch/remove/mergealready place it. Doc mirrors regenerated.