Repository navigation
fix(go): rewrite and filter go -C DIR test, build and vet - #5392
Open
Kernel-Hunter wants to merge 1 commit into
Open
Kernel-Hunter wants to merge 1 commit into
Kernel-Hunter wants to merge 1 commit into
Conversation
The hook only matched go test|build|vet, so go -C DIR test was never rewritten, and rtk go -C DIR test fell back to the raw command. Accept the chdir flag in the rewrite rule and as an option of rtk go, and put it before the subcommand when running go. Fixes rtk-ai#4970
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.
Summary
go test|build|vet, sogo -C DIR test ./...was left alone and the full output reached the agent. Runningrtk go -C DIR testby hand did not help either: clap rejected-Cand the raw-exec fallback ran plaingo, unfiltered.-C DIR,--C DIR,-C=DIRand--C=DIRbefore the subcommand.rtk gotakes the same flag and puts-C DIRbefore the subcommand when it runs go, so-jsonis still injected after it. Other subcommands (go -C DIR mod tidy) are not rewritten, andgo -C DIR tool .../listkeep passing through with the flag.rtk go test -C DIR(flag after the subcommand) behaves as before.Test plan
go -C ./sub mod tidyand a barego -C test, and a clap parse test for the flag before the subcommand and as a plain argument after it.rtk go -C sub test ./...prints the compact failure summary and exits 1;-C=suband--C=subthe same;rtk go -C sub vet/buildrun.cargo fmt --all -- --check,cargo clippy --locked --all-targetsandcargo test --locked --lib(5089 passed) pass on macOS.Fixes #4970