golangci-lint v2.12.2 warns on every run: gomodguard is deprecated in favour of gomodguard_v2 #35

Closed
opened 2026-08-09 07:59:50 +02:00 by clawbot · 1 comment
Collaborator

Now that hosts actually run the pinned v2.12.2 linter (#24 / #34),
every make lint and make check — locally and inside the Docker lint
stage — prints:

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 finding: make lint still reports 0 issues.
and exits 0. But it is noise on every gate run, and gomodguard will
eventually be removed, at which point the config breaks rather than
warns.

The fix is not local: .golangci.yml is the standardized shared config
and per REPO_POLICIES.md must never be edited in-repo, only replaced
wholesale from
https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml. So
this needs gomodguard swapped for gomodguard_v2 in the canonical
file upstream, and then a pull of the updated copy into this repo (the
same shape as #3).

Definition of done

  1. The canonical .golangci.yml enables gomodguard_v2 instead of
    gomodguard.
  2. This repo's .golangci.yml is replaced with the updated canonical
    copy — not hand-edited.
  3. make lint runs without deprecation warnings and still reports
    0 issues.; make check and make docker green.
Now that hosts actually run the pinned v2.12.2 linter (#24 / #34), every `make lint` and `make check` — locally and inside the Docker lint stage — prints: 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 finding: `make lint` still reports `0 issues.` and exits 0. But it is noise on every gate run, and `gomodguard` will eventually be removed, at which point the config breaks rather than warns. The fix is not local: `.golangci.yml` is the standardized shared config and per `REPO_POLICIES.md` must never be edited in-repo, only replaced wholesale from `https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml`. So this needs `gomodguard` swapped for `gomodguard_v2` in the canonical file upstream, and then a pull of the updated copy into this repo (the same shape as #3). ## Definition of done 1. The canonical `.golangci.yml` enables `gomodguard_v2` instead of `gomodguard`. 2. This repo's `.golangci.yml` is replaced with the updated canonical copy — not hand-edited. 3. `make lint` runs without deprecation warnings and still reports `0 issues.`; `make check` and `make docker` green.
Author
Collaborator

Duplicate of #26 — closing in favour of it.

#26 was filed earlier from the same finding during the review of PR #2, and is already assigned to sneak with the two options written out and a recommendation, because the fix belongs in the canonical .golangci.yml in the prompts repo and agents are forbidden to modify that file.

The observation here is correct and independently reached, which is worth something: v2.12.2 warns on every run that gomodguard is deprecated in favour of gomodguard_v2, and now that #24 makes hosts actually run the pinned linter, that warning will be visible on every developer machine rather than only inside the Docker lint stage. Recorded on #26.

Nothing to do here. Follow #26.

Duplicate of #26 — closing in favour of it. #26 was filed earlier from the same finding during the review of PR #2, and is already assigned to `sneak` with the two options written out and a recommendation, because the fix belongs in the canonical `.golangci.yml` in the `prompts` repo and agents are forbidden to modify that file. The observation here is correct and independently reached, which is worth something: v2.12.2 warns on every run that `gomodguard` is deprecated in favour of `gomodguard_v2`, and now that #24 makes hosts actually run the pinned linter, that warning will be visible on every developer machine rather than only inside the Docker lint stage. Recorded on #26. Nothing to do here. Follow #26.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/sfdupes#35