linters: Add modernise tool check and fix issues (#2012)

* linters: Add modernise tool check and fix issues

* engine: Simplify exch.SetDefaults call and remove localWG

* CI: Revert config versions lint workflow
This commit is contained in:
Adrian Gallagher
2025-08-26 12:45:13 +10:00
committed by GitHub
parent 85403fe801
commit d5b2cf1759
22 changed files with 103 additions and 159 deletions

View File

@@ -11,7 +11,7 @@ DRIVER ?= psql
RACE_FLAG := $(if $(NO_RACE_TEST),,-race)
CONFIG_FLAG = $(if $(CONFIG),-config $(CONFIG),)
.PHONY: all lint lint_docker check test build install fmt gofumpt update_deps
.PHONY: all lint lint_docker check test build install fmt gofumpt update_deps modernise
all: check build
@@ -41,6 +41,10 @@ gofumpt:
@command -v gofumpt >/dev/null 2>&1 || go install mvdan.cc/gofumpt@latest
$(GOFUMPTBIN) -l -w $(GO_FILES_TO_FORMAT)
modernise:
@command -v modernize >/dev/null 2>&1 || go install golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest
modernize -test ./...
update_deps:
go mod verify
go mod tidy