golangci-lint v2.12.2 deprecates the gomodguard linter; migrate to gomodguard_v2 #41

Open
opened 2026-08-09 12:16:01 +02:00 by clawbot · 0 comments
Collaborator

Filed from #17 / PR #40 rather than fixed drive-by — it is outside that
issue's scope and belongs to whoever owns the linter configuration.

What happens

Running cd backend && make check on a host whose golangci-lint is
v2.12.2 — the version #14/#31 moves the pin to — emits:

level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0) due to: new major version. Replaced by gomodguard_v2."
level=warning msg="Suggested new configuration:\nlinters:\n  enable:\n    - gomodguard_v2\n"

It is a warning, not a failure: the run still ends 0 issues. and
make check exits 0.

Why it is not visible in CI yet

Dockerfile.backend on main pins golangci-lint v2.7.2
(9f61b0f53f80672872fced07b6874397c3ed197b), which predates the deprecation,
so the containerised gate is silent. The warning only shows on a developer
machine running a newer linter. Once #31 lands and the pin moves to v2.12.2
(c0d3ddc9cf3faa61a4e378e879ece580256d76e5), it will appear in every
docker build -f Dockerfile.backend . log as well.

gomodguard is reached via linters.default: all in backend/.golangci.yml,
so it is enabled without being named anywhere in the config.

Definition of done

  • Decide whether gomodguard_v2 should be enabled, and configured with
    what (today gomodguard has no settings at all, so it is enforcing
    nothing).
  • Whatever the answer, cd backend && make check and
    docker build -f Dockerfile.backend . emit no deprecation warning.
  • Coordinate with #14/#31: backend/.golangci.yml is a byte-for-byte copy
    of the org-standard file guarded by a sha256 assertion, so this cannot
    be a local edit. Either the canonical file in sneak/prompts changes
    and the guard's hash is updated with it, or this issue is closed as
    "upstream's problem" with the reasoning recorded here.
  • Blocked on #31 landing; there is nothing to verify until the pin is
    actually v2.12.2.

Verified on

main at fbfe1df, host golangci-lint
has version 2.12.2 built with go1.26.5, against main's
backend/.golangci.yml.

Filed from #17 / PR #40 rather than fixed drive-by — it is outside that issue's scope and belongs to whoever owns the linter configuration. ## What happens Running `cd backend && make check` on a host whose golangci-lint is **v2.12.2** — the version #14/#31 moves the pin to — emits: ``` level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0) due to: new major version. Replaced by gomodguard_v2." level=warning msg="Suggested new configuration:\nlinters:\n enable:\n - gomodguard_v2\n" ``` It is a warning, not a failure: the run still ends `0 issues.` and `make check` exits 0. ## Why it is not visible in CI yet `Dockerfile.backend` on `main` pins golangci-lint v2.7.2 (`9f61b0f53f80672872fced07b6874397c3ed197b`), which predates the deprecation, so the containerised gate is silent. The warning only shows on a developer machine running a newer linter. Once #31 lands and the pin moves to v2.12.2 (`c0d3ddc9cf3faa61a4e378e879ece580256d76e5`), it will appear in every `docker build -f Dockerfile.backend .` log as well. `gomodguard` is reached via `linters.default: all` in `backend/.golangci.yml`, so it is enabled without being named anywhere in the config. ## Definition of done - [ ] Decide whether `gomodguard_v2` should be enabled, and configured with what (today `gomodguard` has no settings at all, so it is enforcing nothing). - [ ] Whatever the answer, `cd backend && make check` and `docker build -f Dockerfile.backend .` emit no deprecation warning. - [ ] Coordinate with #14/#31: `backend/.golangci.yml` is a byte-for-byte copy of the org-standard file guarded by a sha256 assertion, so this cannot be a local edit. Either the canonical file in `sneak/prompts` changes and the guard's hash is updated with it, or this issue is closed as "upstream's problem" with the reasoning recorded here. - [ ] Blocked on #31 landing; there is nothing to verify until the pin is actually v2.12.2. ## Verified on `main` at `fbfe1df`, host golangci-lint `has version 2.12.2 built with go1.26.5`, against `main`'s `backend/.golangci.yml`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#41