Migrate canonical .golangci.yml to gomodguard_v2, with a block list #55
Reference in New Issue
Block a user
Delete Branch "gomodguard-v2-with-settings"
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?
Speculative, and closing it costs nothing. It is the option-2 answer to
sneak's ruling of 2026-08-19 on
sneak/homoicon#4 ("option 2. owner approves
policy exception in this one case only. update the config for the
updated linter"), where option 2 was migrate to the successor with
settings. The minimal fix, #47,
which disabled the old linter and added no settings, was closed
unmerged; canonical therefore still emits the deprecation warning that
#25 tracks.
The change
golangci-lintv2.12.0 deprecatedgomodguard, and this config setslinters.default: all, so the deprecated linter is enabled everywhereand warns on every run — in the same output where the evidence that a
check actually ran lives.
gomodguardstays inlinters.disable, now grouped withwslundera comment saying why a deprecated linter is retired by disabling the
old name. The warning is attached to the old linter, so silencing it
means removing that one, not adding the new one.
gomodguard_v2is named inlinters.enable.default: allalreadyenables it; naming it is what gives the settings block below a visible
owner.
linters.settings.gomodguard_v2.blockedgets four entries.The v2 settings schema is a flat list of
- module:entries, not v1'slist-of-single-key-maps, and
local-replace-directiveshas moved to thetop level of the settings block. Checked against upstream's
.golangci.next.reference.ymlat the pinned v2.12.2, not from memory,and the file passes
golangci-lint config verifyunder that version.local-replace-directivesis not set: that would be new policy.What is blocked, and why only this
Every entry restates a decision already recorded in the Go package
defaults. Nothing here is a new rule.
github.com/rs/zerologlog/sloggithub.com/go-redis/redis(pre-fork, unversioned)github.com/redis/go-redis/v9github.com/sergi/go-diffgithub.com/aymanbagabas/go-udiffgithub.com/hexops/gotextdiffgithub.com/aymanbagabas/go-udiffEntries match the module path exactly (v2's default
match-type), sothe versioned successor paths are untouched: blocking
github.com/go-redis/redisdoes not touchgithub.com/redis/go-redis/v9.Deliberately not blocked, though the defaults name a winner for each:
github.com/google/uuid— it is the current default, not a rejectedone. It gets replaced only when a stdlib uuid lands.
github.com/urfave/cli(cobra is the default) and the old unversionedgithub.com/go-chi/chi(chi/v5 is the default) — older repos arestill on them and migrate opportunistically. Blocking them canonically
would turn a re-vendor into a red gate in repos that have done nothing
wrong. Follow-up: add both once those migrations have landed. A
canonical config that reddens the fleet on re-vendor is worse than the
warning it removes.
Dropped after checking the fleet (see below):
github.com/mattn/go-sqlite3,gorm.io/gorm,github.com/pmezard/go-difflib. All three are recordedrejections, and all three are required by repos that vendor this file
today, so shipping them would break those repos on their next re-vendor.
Fleet verification
Each vendoring repo's
go.modread through the Gitea API, checkedagainst the candidate block list.
d= direct require,i= indirect.mattn/go-sqlite3(d),gorm.io/gorm(i) — both droppedpmezard/go-difflib(i) — droppedpmezard/go-difflib(i) — droppedpmezard/go-difflib(i) — droppedmattn/go-sqlite3(d),pmezard/go-difflib(i) — droppedpmezard/go-difflib(i) — droppedgorm.io/gorm(d),mattn/go-sqlite3(i),pmezard/go-difflib(i) — droppedNo repo requires any of the four modules that shipped.
The settings are actually applied
A mistyped settings key is silently ignored, and a config that applies
nothing is indistinguishable from a clean run. Against a Go corpus
through its own dockerized lint entrypoint at the pinned v2.12.2, the
committed config plus three temporary probe entries produced 12 findings
attributed to
gomodguard_v2and a non-zero exit; the probe entries werethen removed. Two further results fell out of the same run:
github.com/sergi/go-diffwill catch.../go-diff/diffmatchpatch.produces no finding.
With the committed config alone, that corpus lints clean with no
deprecation warning.
Hashes, and what has to happen after a merge
.golangci.yml:021cc83f4e6fc7c31b95b34b846723dfcf20b66b7baeea1dc40406e643346bcb.golangci.yml:769af9e07ca2f1420da869640c7bc781ce40dac83772d493575bebe686a96ed9Every repo vendoring this file must re-vendor after merge. They
verify by sha256 and will mismatch the moment this lands: dnswatcher,
webhooker, vaultik, rgoue, cattbox, sfdupes, attrsum, upaas, simplelog,
mfer, secret, bsfirehose, pixa.
homoiconis a special case. Its copy carries an authorized divergence —a header comment recording the owner-approved agent edit of 2026-08-07 —
under the one-case exception granted in
sneak/homoicon#4. A re-vendor there must
carry that comment forward, not drop it, and
sneak/homoicon#632 is the open item that will
do the re-vendor.
Disclosures
wslmoved two lines down so it sits withgomodguardunder a shared "deprecated" comment. No behaviour change; it does widen
the diff on a file you own.
pmezard/go-difflibis an indirect requirement only —testify pulls it — in all six repos that have it, and the probe above
shows an indirect-only requirement produces no finding, so it would
probably have been safe. It was dropped anyway, because the rule this
PR followed is "required by any repo, direct or indirect, means drop".
It is the cheapest entry to add back if you would rather have it.
sha256 to be recorded in
REPO_POLICIES.md. Not done here: no hash ispublished there today, so there is nothing to update, and adding a hash
register is a separate decision. That issue is therefore not fully
satisfied by this PR and is left open.
and enforced, and that no shipped entry fires on that corpus. It does
not execute the linter against each of the 13 vendoring repos; the
per-repo claim above rests on reading their
go.modfiles.golangci-lint config verifyresolves its JSON schema over a livenetwork fetch, so treat its pass as corroboration of the schema, not as
the proof. The proof is the probe findings.
TODO.mdgains a Completed Steps entry in the same commit, per itsWorkflow section. The repo's Next Step is unrelated and untouched.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.