fix(gh): rewrite gh search commands#1518
Conversation
📊 Automated PR Analysis
SummaryAdds support for rewriting Review Checklist
Linked issues: #1484 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
Hello, and thanks for the contribution. One issue before merge: routing without an output filter creates a false savings claim.
Quickest fix: add The |
gh search routes through rtk gh but has no output filter (gh_cmd.rs
passes it straight through), so it was inheriting the rule's 82%
savings_pct in the discover projection — overstating the gain on a
command that filters nothing.
Add a ("search", 0.0) subcmd_savings override and mark it
RtkStatus::Passthrough so the projection and status badge reflect
reality, matching the cargo fmt passthrough convention. Tighten
test_classify_gh_search to pin the 0% savings and Passthrough status.
|
Hi, added the fix |
Summary
gh search ...commands throughrtk ghso hook-based integrations no longer leave GitHub search output raw.ghsubcommand boundary so lookalikes likegh searchingorgh repositorydo not get rewritten.gh search repos/issues/prs/code/commits, structured-output passthrough flags, and false-positive subcommand prefixes.Fixes #1484
Test plan
rtk cargo +1.92.0 test test_rewrite_gh_search -- --nocapturertk cargo +1.92.0 test test_rewrite_gh_search_structured_output_skipped -- --nocapturertk cargo +1.92.0 test test_rewrite_gh_subcommands_require_word_boundary -- --nocapturertk cargo +1.92.0 test test_classify_gh_search -- --nocapturertk cargo +1.92.0 test test_all_patterns_are_valid_regex -- --nocapturertk cargo +1.92.0 fmt --all -- --checkrtk cargo +1.92.0 clippy --all-targets(passes with existing warnings)rtk git diff --checkrtk cargo +1.92.0 run --quiet -- rewrite 'gh search repos foo --limit 5'rewrites tortk gh search repos foo --limit 5gh searchstructured output flags (--json) do not rewritegh searching foodo not rewrite