Repository navigation
chore: small drift cleanups from nightly survey - #2549
Merged
Merged
Conversation
- src/cli/hook.rs: replace inline hook-type literal in `wt hook show` with `PossibleValuesParser::new(HOOK_TYPE_NAMES)`. The HOOK_TYPE_NAMES docstring claims the constant is shared with the show value parser "so drift is caught by tests rather than at runtime"; it wasn't. - src/git/repository/working_tree.rs: WorkingTreeGitInfo doc said prewarm_info "still primes RepoCache" but ee242f3 moved those maps to process-wide statics (WORKTREE_ROOTS / GIT_DIRS / CURRENT_BRANCHES). - src/commands/mod.rs: update format_command_label doc example and its test from the deprecated `post-create` to the canonical `post-start` (post-create is a hidden alias for pre-start, see hook.rs:50). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Merged
1 task
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.
Three small drift fixes surfaced by the nightly survey. Each is a doc/DRY cleanup, not a behavior change.
Changes
src/cli/hook.rs—wt hook show'svalue_parserwas hand-rolled with the same ten hook-type strings declared just above asHOOK_TYPE_NAMES. TheHOOK_TYPE_NAMESdocstring even says the constant is "Shared by … thewt hook showvalue parser so drift is caught by tests rather than at runtime" — the show parser wasn't actually using it. Replaced withPossibleValuesParser::new(HOOK_TYPE_NAMES).src/git/repository/working_tree.rs— theWorkingTreeGitInfodocstring still saidprewarm_info"primesRepoCache," but perf(prewarm): fold cold-path rev-parses into one fork #2541 (fd78f60e) and refactor(git): close remaining cache-staleness vectors after RefSnapshot cutover #2530 (ee242f30) moved the per-worktree maps (WORKTREE_ROOTS,GIT_DIRS,CURRENT_BRANCHES) out ofRepoCacheinto process-wideLazyLock<DashMap>statics. Updated the doc to point at the actual statics; dropped the now-orphan intra-doc link toRepoCache.src/commands/mod.rs—format_command_label's docstring example and its test were pinned on"post-create", which is a hidden deprecated alias forpre-startpersrc/cli/hook.rs:50. Replaced with"post-start"so newcomers don't read the example as a current canonical hook name.Test plan
cargo build --binscargo clippy --bins --testscargo test --lib --bins format_command_labelcargo test --test integration hook_show(15 tests pass — value_parser change preserves accept/reject behavior)cargo test --test integration help_(17 tests, including help snapshots —PossibleValuesParser::new(HOOK_TYPE_NAMES)produces identical help output to the inline literal)cargo test --test integration test_docs_are_in_synccargo fmt --check🤖 Generated with Claude Code