From 2a314039196364efd196b2412768be8ed65c16bd Mon Sep 17 00:00:00 2001 From: William Johansson Date: Tue, 3 Dec 2024 08:42:46 +0100 Subject: [PATCH] feat(golangcilint): lint wire files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire is used a lot in our organization, but the linter is skipping all wire.go files due to them having a mandatory build tag. This includes the build tag when running the linter, to make sure `wire.go` files are linted as well. I would expect linter to break a lot of repos now, but likely with very easy fixes. Example: ``` ❯ make go-lint [sage] building binary and generating Makefiles... [go-lint] running... [go-lint] internal/app/server/wire.go:61: File is not `gci`-ed with --skip-generated -s standard -s default (gci) internal/app/server/wire.go:63: File is not `gci`-ed with --skip-generated -s standard -s default (gci) [ ... code ... ] internal/app/server/wire.go:62: File is not `gofumpt`-ed with `-extra` (gofumpt) [ ... code ... ] internal/app/server/wire.go:47:11: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive) func Init(ctx context.Context, config *Config) (*App, func(), error) { ``` --- tools/sggolangcilint/golangci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/sggolangcilint/golangci.yml b/tools/sggolangcilint/golangci.yml index 05c6a7f2..18f8e36a 100644 --- a/tools/sggolangcilint/golangci.yml +++ b/tools/sggolangcilint/golangci.yml @@ -1,5 +1,7 @@ run: timeout: 10m + build-tags: + - wireinject issues: fix: false