Commit Graph

1318 Commits

Author SHA1 Message Date
Adrien Eppling 4d0b37d4ab fix(install): warn when multiple rtk own the name on PATH 2026-07-08 16:15:25 +02:00
aesoft be1844c7c5 Merge pull request #2859 from kenwoodjw/feature/git-checkout-support
feat: add git checkout support
dev-0.44.0-rc.313
2026-07-08 14:05:59 +02:00
kenwoodjw bb01d6c8ba feat: add git checkout support 2026-07-08 11:07:35 +08:00
aesoft d823aaf767 Merge pull request #2732 from mvanhorn/fix/ccusage-period-key
fix(ccusage): accept `period` key from current ccusage
dev-0.44.0-rc.312
2026-07-07 10:20:23 +02:00
aesoft a4b7f7422e Merge pull request #2422 from luccinmasirika/fix/cargo-json-build-failure-2419
fix(cargo): surface --message-format=json build errors instead of "compiled"
dev-0.44.0-rc.311
2026-07-07 09:57:09 +02:00
aesoft 11fa99155d Merge pull request #2853 from rtk-ai/docs/add-contributor
chore(docs): add core contributor
dev-0.44.0-rc.310
2026-07-06 21:02:37 +02:00
aesoft 0b28e47af7 Update README.md 2026-07-06 21:01:19 +02:00
aesoft aee61f2f3f chore(docs): add core contributor 2026-07-06 20:58:27 +02:00
aesoft 6871e55358 Merge pull request #2836 from guyoron1/fix/grep-context-separator
fix(grep): preserve -- separator between non-adjacent match blocks
dev-0.44.0-rc.309
2026-07-06 09:57:21 +02:00
guyoron1 34a0f0e5c0 fix(grep): only insert -- separator when context flags are active
Native grep only prints -- between non-adjacent match blocks when
-A/-B/-C context is requested. The grouped output path was inserting
-- on any line-number gap unconditionally, so `rtk grep -rn todo`
invented separators between every match that grep never emits.

Gate the insertion on has_context_flag() which checks for -A/-B/-C
and their long-form equivalents.
2026-07-06 09:21:11 +03:00
guyoron1 cae9b710d4 fix(grep): preserve -- separator between non-adjacent match blocks
When context flags (-A/-B/-C) are used, grep prints -- between
non-adjacent match blocks. parse_match_line() returned None for
this separator, and both output paths silently dropped it, merging
distinct matches into one contiguous block.

Fixes #2795
2026-07-06 09:21:03 +03:00
Luccin Masirika 1143e6fb63 docs(cargo): explain why run_test has no json branch 2026-07-03 19:48:56 +02:00
Luccin Masirika 6f67c9e6af refactor(cargo): drop CargoBuildHandler new/for_check wrappers 2026-07-03 19:45:49 +02:00
Luccin Masirika 39a4d28d21 refactor(cargo): drop dead json parse from the streamed build handler 2026-07-03 19:44:45 +02:00
Luccin Masirika a3e65e99e9 fix(cargo): give the json batch filter the exit code 2026-07-03 19:42:26 +02:00
Luccin Masirika e0c5306a65 refactor(cargo): put failure summary line first, reuse join_with_overflow 2026-07-03 19:34:04 +02:00
Luccin Masirika 8654edb4cb refactor(cargo): parse json diagnostics into typed structs, count ICE
Deserialize each compiler-message line into typed structs instead of
indexing serde_json::Value, mirroring filter_go_test_json. Route the
internal-compiler-error level into the errors bucket so an ICE is no longer
dropped.
2026-07-03 19:28:52 +02:00
aesoft 31f9d43d81 Merge pull request #2748 from rtk-ai/feat/toml-filters-in-hook
feat(hook): wire TOML filters + better tee tail hint
dev-0.44.0-rc.308
2026-07-03 16:51:04 +02:00
aesoft 1b38eece9b Merge pull request #2801 from rtk-ai/fix/git-stash-show-diffstat
fix(git): compact git stash show instead of forcing -p
dev-0.44.0-rc.307
2026-07-03 15:22:20 +02:00
Adrien Eppling b619ecfb24 test(git): update stash summary tests for comma-free format 2026-07-03 14:57:47 +02:00
aesoft 6c3d81f970 no commas 2026-07-03 14:06:23 +02:00
Adrien Eppling 0ac5f5c311 fix(git): compress git stash show summary line
Shorten "N files changed, X insertions(+), Y deletions(-)" to "N changed, X +, Y -"; numbers preserved, no signal loss.
2026-07-03 13:39:50 +02:00
aesoft e20076433e Merge pull request #2789 from rtk-ai/fix/analytics-utf8-char-boundary-panic
fix(analytics): truncate display strings on UTF-8 char boundaries
dev-0.44.0-rc.306
2026-07-03 12:24:31 +02:00
Luccin Masirika 1f74614ea8 fix(cargo): keep "No issues found" wording for clean clippy json runs
Routing clippy json through the build filter reported a clean run as
"cargo clippy (N crates compiled)". Detect the clean case up front and emit
the same "cargo clippy: No issues found" the human path uses; errors and
warnings still route through the diagnostics summary.
2026-07-03 12:22:44 +02:00
Adrien Eppling c9468ee178 fix(analytics): floor prefix slices to char boundary instead of full-string fallback 2026-07-03 12:18:58 +02:00
Adrien Eppling add35e0928 fix(git): compact git stash show instead of forcing -p
Strip the diffstat decorations and cap the file list; savings are measured against the real command, not an inflated -p patch.
2026-07-03 12:14:01 +02:00
Luccin Masirika 59ed885752 fix(cargo): match the human path when skipping the json warning summary
cargo emits "\`crate\` generated N warnings" which ends in "warning", so the
ends_with("generated") check never matched it and the summary could inflate
the count. Use contains, matching the human-text skip elsewhere in the file.
2026-07-03 12:06:59 +02:00
Luccin Masirika c02becb79b refactor(cargo): thread label to handler in filter_cargo_build_labeled
The batch filter built the handler with a hardcoded "build" label. It is
unused today (only the free summary functions receive the label) but would
silently mislabel if the function ever called handler.format_summary. Pass
the real label through.
2026-07-03 12:05:37 +02:00
Luccin Masirika 25d6a09c01 fix(cargo): honor last --message-format when the flag is repeated
cargo uses last-flag-wins, so --message-format=json --message-format=human
builds in human format. Track the last occurrence instead of returning on
the first json match.
2026-07-03 12:04:22 +02:00
Luccin Masirika 751bf3e760 revert(cargo): drop --message-format=json install routing
cargo install --message-format=json is effectively never used, and routing
its success through the build filter dropped the "Installed <crate>" line
(cargo prints it as plain text, not a json record). Keep install on its
dedicated filter which preserves that information.
2026-07-03 11:59:41 +02:00
Luccin Masirika e4bfe3593c fix(cargo): restore failure check before trusting reused build filter
The !is_empty() guard was always true (filter_cargo_build_labeled never
returns empty), making the last-5-lines fallback dead code and letting a
success-shaped line through on a false-positive compile-error detection.
Check for the "cargo test:" failure summary instead.
2026-07-03 11:58:30 +02:00
Luccin Masirika 7fb9459fc6 fix(cargo): surface --message-format=json install errors 2026-07-03 11:19:34 +02:00
Luccin Masirika 58abbf253c fix(cargo): surface --message-format=json clippy errors 2026-07-03 11:16:35 +02:00
aesoft 9f631511ca Merge pull request #2791 from rtk-ai/docs/windows-native-hook
docs(windows): document native binary hook support
dev-0.44.0-rc.305
2026-07-03 11:07:33 +02:00
Luccin Masirika f9b720c8f7 fix(cargo): surface --message-format=json test compile errors 2026-07-03 10:58:13 +02:00
Luccin Masirika 90b4f5f40f fix(cargo): label check output as "check" instead of "build" 2026-07-03 10:56:26 +02:00
patrick 129104e388 docs(windows): document native binary hook support
Native Windows has had full auto-rewrite support since v0.37.2 via the
`rtk hook claude` native binary command (no bash/jq/Unix shell). The
README still described the pre-v0.37.2 "CLAUDE.md fallback" behavior,
which is now inaccurate and a recurring source of confusion (#330).

- Rewrite the Windows section: native binary hook is the primary path,
  WSL secondary; drop the "limited support / CLAUDE.md fallback" framing
- Add an upgrade note (re-run `rtk init -g` to migrate off rtk-rewrite.sh)
- Add a ripgrep prerequisite note (`rg` on PATH)
- Fix the install note and Supported AI Tools table (bash -> native binary)

Refs #330

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 22:54:40 +02:00
Adrien Eppling 47b22e03a4 fix(analytics): truncate display strings on UTF-8 char boundaries
rtk gain --history panicked with "byte index 22 is not a char
boundary" when a tracked command contained non-ASCII text (Cyrillic,
CJK, emoji). The same byte-slicing pattern existed in the --failures
display (top commands, recent failures, timestamp prefix) and in the
session id column of rtk session, all reproduced as real panics.

Replace the ad-hoc byte-based truncations with the shared char-safe
core::utils::truncate() helper, and use .get(..n).unwrap_or() for the
timestamp and session id prefix slices so they fall back to the full
string instead of panicking. Output is byte-identical to the previous
behavior for pure-ASCII data.

Fixes #2787
2026-07-02 15:28:41 +02:00
Adrien Eppling 2d487cb947 fix(trust): surface parse errors, skip already-trusted files, fail loudly when non-interactive 2026-07-02 13:35:54 +02:00
Adrien Eppling 315a94398e fix(filter): address review findings in the TOML filter path
Recoverable loss for a fired head/max cut (never a bare marker), schema-gate the hook match set, parse-error probe for trust; + tests.
2026-07-02 13:35:53 +02:00
Luccin Masirika 6c9a60d83e fix(cargo): tighten json warning-summary skip to ends_with
contains("generated") could swallow a real diagnostic mentioning both
"warning" and "generated"; the rustc summary record ends with "generated",
so match that precisely.
2026-07-02 01:18:11 +02:00
Luccin Masirika d12528055c test(cargo): drop flaky tee-capture test
The test set a shared RTK_TEE_DIR and read back the tee file, but with the
finding-1 tee call other parallel tests now write to the same dir and the
max_files cleanup could evict the file before the read. The overflow line and
true totals are already covered by test_filter_cargo_build_json_errors_capped,
and force_tee_hint has its own tests in core/tee.rs.
2026-07-02 01:11:07 +02:00
Luccin Masirika 5ea03f3d1b feat(cargo): route --message-format=json builds through explicit arg detection
Detect --message-format=json (and the json-* variants, inline and
space-separated) in the args and route build/check to the batch
filter_cargo_build path instead of inferring json mode from output content.
Makes json routing an explicit decision and removes reliance on the
has_compile_errors invariant.
2026-07-02 00:34:06 +02:00
Luccin Masirika 9f20821e7c refactor(cargo): single-alloc cargo_build_success_line 2026-07-01 21:38:54 +02:00
Luccin Masirika ff6cebda45 refactor(cargo): extract shared json diag count merge 2026-07-01 21:38:11 +02:00
Luccin Masirika cf1caf93b8 fix(cargo): tee-hint dropped json diagnostics beyond the cap 2026-07-01 21:37:36 +02:00
Luccin Masirika b47653a9ec fix(cargo): strip ansi from json rendered diagnostics 2026-07-01 21:33:56 +02:00
Luccin Masirika 9ae0872aee fix(cargo): skip "N warnings generated" record in json diagnostics 2026-07-01 21:30:36 +02:00
Adrien Eppling 34c0bcf2da perf(hook): match TOML filters with a match-only RegexSet
The rewrite path only needs a yes/no match, not the full compiled pipeline find_matching_filter forces on every not-in-RULES command (~10ms/call saved; selection still uses find_matching_filter in run_fallback).
2026-07-01 16:35:08 +02:00
Adrien Eppling a4872d9bbf fix(gain): note untrusted custom filters so they can be re-trusted 2026-07-01 15:55:45 +02:00