Removing old guards, windows can now just use the binary hook engine from 0.37
Related issues:
- Fixes#502 : rtk init --global falls back to --claude-md on Windows
- Fixes#1353 : Feature request: hook-based mode on Windows
- Partially addresses #330 : Add hooks support for Windows
- Partially addresses #913 : Persistent "No hook installed" warning on Windows
- Partially addresses #1373 : Suppress "No hook installed" warning on Windows
- Partially addresses #682 : Config to suppress hook warning
- Related to #1248 : Windows PowerShell compatibility gaps
Supersedes community PRs:
- #1123 fix(init): enable hook installation on Windows
- #1027 fix(init): enable hook-based mode on Windows
- #809 feat: enable hook-based mode on Windows
- #452 feat: add Windows hook support for rtk init --global
- #551 feat: native cross-platform hook for Windows support
- #150 feat(hook): native cross-platform hook-rewrite command
- #1063 Feat/windows hooks
Replace \b with ($|\s) to only match end-of-string or whitespace.
Empty string and bare "^" patterns produce regexes that match all commands, silently disabling all rewrites on a config typo. Skip
trivial patterns with an eprintln warning.
Strip env prefix (sudo, VAR=val) before exclude check so PGPASSWORD=x psql matches ["psql"]. Match against full command instead of first token so ["git push"] matches "git push origin main".
Compile exclude entries as regex so ["^curl"] works as pattern.
Invalid regex falls back to prefix match with eprintln warning.
Non-regex patterns auto-anchor with ^ and \b to prevent substring matches (e.g. "go" won't exclude "golangci-lint").
B6 — report.rs:already_rtk integer division truncated small ratios to 0%
(e.g. 3/1000 showed "0%" instead of "0.3%"). Now uses f64 division with
one decimal place. Three regression tests added.
B7 — mod.rs:SupportedBucket.savings_pct was set once from the first-seen
sub-command and never updated. For buckets containing multiple sub-commands
(e.g. git add + git diff + git log all under "rtk git"), the displayed
estimated_savings_pct reflected only the first classification. Fix: track
total_raw_output_tokens alongside total_output_tokens (savings). Compute
effective_savings_pct = saved / raw * 100 at entry construction, giving a
weighted average across all sub-commands in the bucket. This rate is exposed
in rtk discover --format json via estimated_savings_pct.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
The global --ultra-compact flag used -u as its short form which caused
`rtk git push -u origin <branch>` to silently consume -u as ultra-compact
mode instead of forwarding it to git as --set-upstream. The push succeeded
but the upstream tracking branch was never written to .git/config, causing
subsequent plain `git push` calls to fail with "no upstream branch".
Fixes#1086
Generated by Claude Code
Vibe coded by ousamabenyounes
Co-Authored-By: Claude <noreply@anthropic.com>
When glob_matches processed a pattern like "git -C * diff:*" (normalized
to "git -C * diff *"), middle segment " diff " requires a trailing space
to match. For "git -C /path diff" the remaining text is "/path diff"
which ends with " diff" — no trailing space — so .find(" diff ") returned
None and the command was incorrectly rejected.
Fix: in the middle-segment branch, if the full substring search fails,
also check if the remaining text ends with the trimmed (right-stripped)
segment. This handles commands that terminate at the middle token with
no trailing arguments.
Add regression test covering the exact reproduction case from the issue.
Closes#1105
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rtk find used WalkBuilder with .hidden(true), which skips ALL hidden
files and directories. As a result, `rtk find . -name ".claude.json"`
always returned "0 for '.claude.json'" even when the files existed.
Fix: detect when the -name pattern starts with a dot and set
.hidden(false) for that walk, so hidden entries are visited.
Non-dotfile patterns keep the default .hidden(true) behaviour.
Add regression tests covering both cases.
Closes#1101
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Handle --flag=value forms consistently in both the runtime parser and discover rewrite logic.
Add regression coverage for classify and rewrite paths using inline global flag values before run.
Normalize golangci-lint global flags before run during classification and keep them in rewritten commands.
Add regression coverage for classify_command and rewrite_command with pre-run global flags.
Keep bare golangci-lint invocations as passthrough while preserving compact filtering for golangci-lint run.
Update discover/rewrite rules, regression tests, and docs to advertise only the supported compact run path.
This reverts commit 94a35325790a8a62715e66863ad5a6cd17417d81.
Build is no longer a pnpm command with specific handling.
Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>