fix(hooks): skip hook-installed warning on Windows#1376
Open
niklasmarderx wants to merge 1 commit intortk-ai:developfrom
Open
fix(hooks): skip hook-installed warning on Windows#1376niklasmarderx wants to merge 1 commit intortk-ai:developfrom
niklasmarderx wants to merge 1 commit intortk-ai:developfrom
Conversation
Hooks require Unix; Windows users fall back to `--claude-md` mode after running `rtk init -g`. Since there is no way to install a hook on Windows, the "No hook installed" warning is unresolvable and shows on every command. Return `HookStatus::Ok` unconditionally on Windows so the warning is never emitted. Added a `#[cfg(windows)]` test to document the invariant. Closes rtk-ai#1373
Collaborator
📊 Automated PR Analysis
SummarySkips the 'No hook installed' warning on Windows by returning HookStatus::Ok unconditionally via a #[cfg(windows)] guard, since hooks are Unix-only and Windows users have no way to install them. Includes a Windows-only test to document this invariant. Review Checklist
Linked issues: #1373 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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.
Hooks require Unix; Windows users fall back to
--claude-mdmode after runningrtk init -g. Since there is no way to install a hook on Windows, the "No hook installed" warning shows on every command with no way to suppress it.The fix is a single
#[cfg(windows)]guard instatus()that returnsHookStatus::Okunconditionally. No env var, no config key — the platform already tells us hooks aren't applicable.Added a
#[cfg(windows)]test to document the invariant. All existing tests pass.Closes #1373