1 Commits
Author SHA1 Message Date
clawbot 1c903bae5e Migrate canonical .golangci.yml to gomodguard_v2 with a block list (closes #25)
check / check (push) Successful in 58s
golangci-lint v2.12.0 deprecated gomodguard, and `linters.default: all`
enables it, so every lint run in every consuming Go repo prints a
deprecation warning. Disable the old name, which is what silences the
warning; name gomodguard_v2 in linters.enable so the settings block has
a visible owner; give it a blocked module list.

The list restates only decisions already recorded in the Go package
defaults: zerolog, the pre-fork go-redis/redis, sergi/go-diff and
hexops/gotextdiff. The go-redis entry matches by prefix, because the
pre-fork module's later releases are separate module paths that an
exact match would let through; the successor sits under a different
prefix. Recorded rejections that vendoring repos still require are
deliberately absent, so a re-vendor cannot redden a repo that has done
nothing wrong.

Model: opus-5
2026-09-08 05:07:40 +00:00
+7 -13
View File
@@ -61,26 +61,20 @@ linters:
Test-support code belongs in test files and in packages whose
directory name ends in test, not in the shipped binary.
# Only decisions already recorded in the Go package defaults are
# listed here. Every entry matches the module path exactly.
# listed here. An entry matches the module path exactly unless it
# sets a match-type.
gomodguard_v2:
blocked:
- module: github.com/rs/zerolog
recommendations:
- log/slog
reason: "Structured logging is stdlib log/slog."
# One entry per pre-fork module path, because the later releases
# are separate paths. A prefix match would be shorter but would
# also reach github.com/go-redis/redismock, the test double for
# the successor these entries recommend.
# Prefix, because the pre-fork module's later releases are
# separate module paths (.../redis/v7, .../redis/v8) that an
# exact match would let through. The successor is under
# github.com/redis/go-redis/, which this prefix does not cover.
- module: github.com/go-redis/redis
recommendations:
- github.com/redis/go-redis/v9
reason: "Pre-fork module; use the maintained go-redis v9."
- module: github.com/go-redis/redis/v7
recommendations:
- github.com/redis/go-redis/v9
reason: "Pre-fork module; use the maintained go-redis v9."
- module: github.com/go-redis/redis/v8
match-type: prefix
recommendations:
- github.com/redis/go-redis/v9
reason: "Pre-fork module; use the maintained go-redis v9."