golangci-lint warns on every run: gomodguard deprecated, replaced by gomodguard_v2
#38
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Noticed while working #32; filing rather than fixing drive-by, since it
is outside that issue's scope.
Every
make lintand everymake checkrun, locally and inside theDockerfilegates, emits:.golangci.ymlsetslinters.default: all, sogomodguardis pulledin implicitly rather than named anywhere — the deprecation arrived with
the v2.12.2 bump from #3 and nothing in the repo config mentions it.
Not currently harmful: it is a warning, the exit status is unaffected,
and
make checkis green. But it is noise on top of every gate run,which is exactly the kind of thing reviewers learn to scroll past, and
a deprecated linter will eventually be removed.
Definition of done
make lintandmake checkproduce no deprecation warnings.gomodguard_v2, ordisabling
gomodguardunderlinters.disableif the v2 linter isnot wanted), it is a deliberate choice recorded in a comment in
.golangci.ymlrather than a silent config edit — the file alreadycarries a comment explaining the v2 schema layout.
make checkandmake dockergreen.Worth checking whether the canonical
.golangci.ymlupstream inpromptshas already dealt with this; prefer re-vendoring over a localdivergence if so.
Duplicate of #26 — closing in favour of it. This is the third independent rediscovery of the same warning (#26 from the review of PR #2, #35 during #24, and now this one), which is itself a useful signal: it is unmissable noise on every gate run.
#26 is assigned to
sneakwith both options written out and a recommendation, because the fix belongs in the canonical.golangci.ymlin thepromptsrepo andREPO_POLICIES.mdforbids agents from editing that file in-repo.To answer the suggested next step directly: enabling
gomodguard_v2explicitly here is not an available option, even with a comment recording the choice. This repo's.golangci.ymlis byte-identical to the canonical file (sha256021cc83f...346bcb) and must stay that way — a local edit would both violate the policy and silently drift the repo off the org standard, which is exactly the class of problem #20 exists to clean up. The only correct sequence is: canonical file updated upstream, then re-vendored here wholesale.Nothing to do in this repo until that happens. Follow #26.