lint: resolve all revive findings #584

Open
opened 2026-09-22 17:10:52 +00:00 by hexajon · 0 comments
Owner

Context

revive reports 29 findings under the configured ruleset. Most are shadowed
builtins.

What

  • redefines-builtin-id (most findings): locals and params named min, max,
    cap, copy, real, any. These are all builtins in current Go. Rename at
    every site, callers included. internal/opspec/cli.go exports (min, max int)
    in a public signature, so the renames are caller-visible; use an LSP rename
    and check the callsites. Other sites: internal/service/adr/adr.go,
    internal/service/git/worktree.go, internal/config/version.go
    (cap Capability), internal/format/format.go (Truncate(s, max)),
    internal/gitea/client.go (copy := *c, three times),
    internal/cmd/file/file.go (any := false, also a clarity bug),
    internal/parity/layering.go, plus the test mirrors
    internal/opspec/cli_test.go and
    internal/service/orchestrate/reconcile_test.go.
  • early-return x4: invert the if/else in internal/cmd/org/hooks.go,
    internal/cmd/setup/setup.go, internal/gitea/resolve.go,
    internal/mcp/tools_orchestrate.go.
  • var-declaration x3: drop the redundant explicit function types in
    internal/util/input.go and internal/cmd/setup/web.go (two sites). Check
    that the web.go pair are not test-substitution seams. If they are, keep the
    type and explain why in this issue.
  • error-strings x3: reword the test sentinel errors. Verify no test asserts
    on the exact string first.
  • context-as-argument x2: reorder the params in the
    internal/mcp/completions_test.go helpers.

Acceptance

  • golangci-lint reports zero revive findings.
  • Public-signature renames verified through LSP references, not text search.
  • go test ./... stays green.
## Context revive reports 29 findings under the configured ruleset. Most are shadowed builtins. ## What - `redefines-builtin-id` (most findings): locals and params named `min`, `max`, `cap`, `copy`, `real`, `any`. These are all builtins in current Go. Rename at every site, callers included. `internal/opspec/cli.go` exports `(min, max int)` in a public signature, so the renames are caller-visible; use an LSP rename and check the callsites. Other sites: `internal/service/adr/adr.go`, `internal/service/git/worktree.go`, `internal/config/version.go` (`cap Capability`), `internal/format/format.go` (`Truncate(s, max)`), `internal/gitea/client.go` (`copy := *c`, three times), `internal/cmd/file/file.go` (`any := false`, also a clarity bug), `internal/parity/layering.go`, plus the test mirrors `internal/opspec/cli_test.go` and `internal/service/orchestrate/reconcile_test.go`. - `early-return` x4: invert the if/else in `internal/cmd/org/hooks.go`, `internal/cmd/setup/setup.go`, `internal/gitea/resolve.go`, `internal/mcp/tools_orchestrate.go`. - `var-declaration` x3: drop the redundant explicit function types in `internal/util/input.go` and `internal/cmd/setup/web.go` (two sites). Check that the web.go pair are not test-substitution seams. If they are, keep the type and explain why in this issue. - `error-strings` x3: reword the test sentinel errors. Verify no test asserts on the exact string first. - `context-as-argument` x2: reorder the params in the `internal/mcp/completions_test.go` helpers. ## Acceptance - golangci-lint reports zero revive findings. - Public-signature renames verified through LSP references, not text search. - `go test ./...` stays green.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#584
No description provided.