From 8225d55fc6f3f5cc386ae65d2a9de01a178ce8f3 Mon Sep 17 00:00:00 2001 From: hedhyw Date: Sat, 12 Oct 2024 10:54:12 +0300 Subject: [PATCH] chore: upgrade golangci-lint to v1.61.0 --- .golangci.json | 16 ++++++---------- Makefile | 9 +++++---- pkg/dialect/base/helper_number_test.go | 1 + pkg/dialect/base/helper_web_test.go | 1 + 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.golangci.json b/.golangci.json index cc61d75..7e2a963 100644 --- a/.golangci.json +++ b/.golangci.json @@ -12,16 +12,12 @@ "nolintlint", "depguard", "goconst", - "maligned", - "structcheck", - "varcheck", - "nosnakecase", - "interfacer", - "golint", - "scopelint", - "exhaustivestruct", - "ifshort", - "deadcode" + "exportloopref", + "mnd", + "copyloopvar", + "execinquery", + "govet", + "intrange" ] }, "linters-settings": { diff --git a/Makefile b/Makefile index 57313c7..82b991a 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -GOLANG_CI_LINT_VER:=v1.55.2 +GOLANG_CI_LINT_VER:=v1.61.0 COVER_PACKAGES=${shell go list ./... | grep -Ev 'test|cmd' | tr '\n' ','} all: lint test .PHONY: all -lint: bin/golangci-lint - ./bin/golangci-lint run +lint: bin/golangci-lint-$(GOLANG_CI_LINT_VER) + ./bin/golangci-lint-$(GOLANG_CI_LINT_VER) run .PHONY: lint test: @@ -27,11 +27,12 @@ tidy: go mod tidy .PHONY: vendor -bin/golangci-lint: +bin/golangci-lint-$(GOLANG_CI_LINT_VER): curl \ -sSfL \ https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \ | sh -s $(GOLANG_CI_LINT_VER) + mv bin/golangci-lint bin/golangci-lint-$(GOLANG_CI_LINT_VER) build: go build -o ./bin/rex ./cmd/generator/main.go diff --git a/pkg/dialect/base/helper_number_test.go b/pkg/dialect/base/helper_number_test.go index fa40455..cdbd102 100644 --- a/pkg/dialect/base/helper_number_test.go +++ b/pkg/dialect/base/helper_number_test.go @@ -16,6 +16,7 @@ func TestNumberRange_broot(t *testing.T) { for i := -100; i < 100; i++ { for j := i; j < 100; j++ { + // nolint: gosec // It's a test, and range is defined in the loop. newNumberRangeTestCase(int32(i), int32(j)).Run(t, 100) } } diff --git a/pkg/dialect/base/helper_web_test.go b/pkg/dialect/base/helper_web_test.go index df5aae5..dba4123 100644 --- a/pkg/dialect/base/helper_web_test.go +++ b/pkg/dialect/base/helper_web_test.go @@ -226,6 +226,7 @@ func FuzzIPv4(f *testing.F) { expected := net.ParseIP(fuzzIP) != nil actual := re.MatchString(fuzzIP) + if expected != actual { t.Errorf("Actual: %v, Expected: %v", actual, expected) }