Skip to content

fix(hooks): skip hook-installed warning on Windows - #1376

Closed
niklasmarderx wants to merge 1 commit into
rtk-ai:developfrom
niklasmarderx:fix/no-hook-warn-windows
Closed

niklasmarderx wants to merge 1 commit into
rtk-ai:developfrom
niklasmarderx:fix/no-hook-warn-windows

Conversation

@niklasmarderx

Copy link
Copy Markdown
Contributor

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 shows on every command with no way to suppress it.

The fix is a single #[cfg(windows)] guard in status() that returns HookStatus::Ok unconditionally. 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

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 #1373
@pszymkowiak pszymkowiak added bug Something isn't working effort-small Quelques heures, 1 fichier good first issue Good for newcomers labels Apr 18, 2026
@pszymkowiak

Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Skips 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

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #1373


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@niklasmarderx niklasmarderx closed this by deleting the head repository Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working effort-small Quelques heures, 1 fichier good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants