fix(toolchain): gate lint code-fix behind --code-fix - #2652
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 1m 4s —— View job Security review complete ✅
No security issues found. This PR is documentation/skill-instruction and config-only (
The Per the security-review skill's scope, this lane reports security issues only — no style/naming/coverage commentary. |
|
Last security-reviewed head: |
|
Claude finished @kyle-sexton's task in 1m 15s —— View job Security review —
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbe337de71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude finished @kyle-sexton's task in 3m 23s —— View job Code review complete
Skip gate: PR is open, not draft, and the change (191/-43 across 20 files) has real review surface — proceeded with full review. Root SummaryThis PR splits
No correctness or maintainability issues found that a careful reviewer would block on — this is a well-scoped, self-consistent change with no stale references to the old single- One low-confidence, non-blocking observation (not filed as a finding): Author-claimed and unverified by me (no tool access to run them in this environment): catalog/cheatsheet |
|
Claude has reviewed this PR 2 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
bbe337d to
27d7d93
Compare
Split format-only --fix from semantic lint autofixes: bundled fix-cmd defaults are format-only; code-fix-cmd holds ruff/golangci/biome code-changers behind confirmation, --yes, --dry-run, and a 40-file cap. Go format/code-fix substitute only *.go paths, grouped by package dir. Closes #2649. Version 0.13.0. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
27d7d93 to
aea2b4f
Compare
Clarify that gofmt and golangci-lint --fix receive only *.go paths from <files>, and that golangci-lint is invoked once per package directory. Add lint skill evals covering both review findings. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
MD012 failed hygiene on consecutive blank lines after the Go format/code-fix guidance. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
f8f05c3 to
3bee855
Compare
Regenerate docs/CATALOG.md so plugin-gate matches the repo-fleet-hygiene manifest description already on main. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
3bee855 to
9ce0ae3
Compare
|
Claude finished @cursor[bot]'s task in 3m 46s —— View job Code review complete
Skip gate: PR has real review surface (225/-44 across 20 files, doc/skill/config-only). Proceeded with full review. ScopeReviewed the full diff at head
FindingOne inline comment posted:
Verified
Author-claimed and not independently re-verified by me (no tool access to run them): catalog/cheatsheet |
|
|
||
| **`<files>` substitution:** expand to the ecosystem-scoped changed-file list (paths relative to the execution root). Prefer this scoped list over whole-tree `.` / `./...` whenever the command string contains `<files>`. Under `/toolchain:lint all` with an empty detection set, expand to the matching files under each project root (or the repo root) rather than inventing a silent whole-tree rewrite for code-fix — and still apply the [file-cap](#code-fix-scope-fence) to that expanded set. | ||
|
|
||
| **Go `*.go` filter for format/code-fix:** ecosystem `globs` include `go.mod` / `go.sum`, but `gofmt -w` and `golangci-lint run --fix` reject non-source inputs (`gofmt` exits 2 on `go.mod`; `golangci-lint` requires named files in one directory). When substituting `<files>` into Go `format-cmd` / `code-fix-cmd`, drop every non-`.go` path first. For `golangci-lint run --fix`, further partition the remaining `.go` paths by parent directory and invoke once per directory (never pass a multi-directory file list in one process). If filtering leaves zero `.go` files, skip that Go format/code-fix command and report the skip rather than invoking the tool on module metadata alone. |
There was a problem hiding this comment.
Wrong key name: format-cmd doesn't exist in the contract.
When substituting
<files>into Goformat-cmd/code-fix-cmd, drop every non-.gopath first.
The schema/contract key is fix-cmd, not format-cmd — every other reference in this file, in ecosystem.schema.json, and in reference/ecosystems/go.yaml consistently says fix-cmd. This is the only spot that uses format-cmd. Since this skill is LLM-interpreted rather than parsed, a wrong key name here risks the agent looking for a format-cmd key that doesn't exist when resolving the Go ecosystem config. Suggest changing to fix-cmd:
| **Go `*.go` filter for format/code-fix:** ecosystem `globs` include `go.mod` / `go.sum`, but `gofmt -w` and `golangci-lint run --fix` reject non-source inputs (`gofmt` exits 2 on `go.mod`; `golangci-lint` requires named files in one directory). When substituting `<files>` into Go `format-cmd` / `code-fix-cmd`, drop every non-`.go` path first. For `golangci-lint run --fix`, further partition the remaining `.go` paths by parent directory and invoke once per directory (never pass a multi-directory file list in one process). If filtering leaves zero `.go` files, skip that Go format/code-fix command and report the skip rather than invoking the tool on module metadata alone. | |
| **Go `*.go` filter for format/code-fix:** ecosystem `globs` include `go.mod` / `go.sum`, but `gofmt -w` and `golangci-lint run --fix` reject non-source inputs (`gofmt` exits 2 on `go.mod`; `golangci-lint` requires named files in one directory). When substituting `<files>` into Go `fix-cmd` / `code-fix-cmd`, drop every non-`.go` path first. For `golangci-lint run --fix`, further partition the remaining `.go` paths by parent directory and invoke once per directory (never pass a multi-directory file list in one process). If filtering leaves zero `.go` files, skip that Go format/code-fix command and report the skip rather than invoking the tool on module metadata alone. |
Closes #2649
Summary
Split
/toolchain:lint --fix(format-onlyfix-cmd) from semantic lint autofixes (code-fix-cmdvia--code-fix).Fix
--fix→ format-only (fix-cmd); no semantic autofixes--code-fix→code-fix-cmdbehind plan + confirmation /--yes, with--dry-runand a 40-file scope cap (--all-filesoverride)--unfixable F401(aligned withruff-format)code-fix-cmd; toolchain 0.13.0Verification
--checkorigin/mainruff check --fix/golangci-lint --fix/biome check --writeon bundledfix-cmdlines--fix, confirmation stop, and file-capRelated
Refs #2597 — fleet drain context (new issue claimed during drain).