Skip to content

Commit

Permalink
chore: upgrade golangci-lint to v1.61.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hedhyw committed Oct 12, 2024
1 parent 6a23c62 commit 8225d55
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
16 changes: 6 additions & 10 deletions .golangci.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
1 change: 1 addition & 0 deletions pkg/dialect/base/helper_number_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/dialect/base/helper_web_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 8225d55

Please sign in to comment.