fix(golangci-lint): restore run wrapper and preserve global-flag rewrites#798
fix(golangci-lint): restore run wrapper and preserve global-flag rewrites#798mgierok wants to merge 3 commits intortk-ai:developfrom
Conversation
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.
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.
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.
|
This PR fixes a regression in the ProblemThe original regression came from shifting That created two distinct problems. 1. Runtime wrapper regression
At the same time, bare That made the public interface inconsistent with the intended contract:
2. Rewrite / discovery regressionsAfter narrowing the compact path to golangci-lint -v run ./...
golangci-lint --color never run ./...That meant hook users could silently fall back to the raw verbose command even though the runtime wrapper explicitly supports those forms. A second bug affected the standard inline syntax: golangci-lint --color=never run ./...
golangci-lint --config=foo.yml run ./...Both the runtime parser and the rewrite/discovery parser normalized FixThis PR is intentionally split into 3 commits, each tightening one part of the behavior: 1. Restore the wrapper contractThe wrapper keeps a single public entrypoint for Only invocations whose first real upstream subcommand is In the filtered path, 2. Restore rewrite/discovery support for pre-
|
📊 Automated PR Analysis
SummaryRestores the golangci-lint run wrapper so that only Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Summary
This PR fixes a regression in the
golangci-lintwrapper and restores consistency between runtime behavior,discover/rewrite, and the documented compact path.It includes exactly these 3 commits:
fix(golangci-lint): restore run wrapper and align guidancefix(discover): preserve golangci-lint flags in rewritefix(golangci-lint): support inline global flags before runWhat changed
rtk golangci-lintas a single wrapper entrypoint with passthrough for non-runinvocationsrtk golangci-lint run ...discover/rewriteso global flags beforerunare preserved--flag=valuehandling in both runtime parsing and rewrite/discoveryrtk golangci-lint run ...Validation
Targeted checks passed:
rtk cargo test golangci_cmd -- --nocapturertk cargo test discover::registry -- --nocapturertk cargo run -- rewrite 'golangci-lint --color=never run ./...'Local full gate status:
rtk cargo fmt --all --checkpassedrtk cargo clippy --all-targetsreported one existing warning insrc/rake_cmd.rsrtk cargo testin this environment still hits pre-existing tracking DB file failures unrelated to this PR