Skip to content

Commit 7c3fbd4

Browse files
committed
Limit golangci-lint version
Limit golangci-lint version to 1.23.8 due to memroy issue[1]. In addition its generaly recommended to fix the linter version to avoid unexpectedly failing on the project in case of new checks that are added. [1] golangci/golangci-lint#994
1 parent d7e3317 commit 7c3fbd4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ IMAGE_BUILD_OPTS += $(DOCKERARGS)
3434
# Go tools
3535
GO = go
3636
GOFMT = gofmt
37-
GOLINT = $(GOBIN)/golangci-lint
37+
GOLANGCI_LINT = $(GOBIN)/golangci-lint
38+
# golangci-lint version should be updated periodically
39+
# we keep it fixed to avoid it from unexpectedly failing on the project
40+
# in case of a version bump
41+
GOLANGCI_LINT_VER = v1.23.8
3842
TIMEOUT = 15
3943
Q = $(if $(filter 1,$V),,@)
4044

@@ -65,8 +69,8 @@ fmt: ; $(info running gofmt...) @ ## Run gofmt on all source files
6569
$(GOFMT) -l -w $$d/*.go || ret=$$? ; \
6670
done ; exit $$ret
6771

68-
$(GOLINT): | $(BASE) ; $(info building golangci-lint...)
69-
$Q go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
72+
$(GOLANGCI_LINT): | $(BASE) ; $(info building golangci-lint...)
73+
$Q curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) $(GOLANGCI_LINT_VER)
7074

7175
GOVERALLS = $(GOBIN)/goveralls
7276
$(GOBIN)/goveralls: | $(BASE) ; $(info building goveralls...)
@@ -75,10 +79,10 @@ $(GOBIN)/goveralls: | $(BASE) ; $(info building goveralls...)
7579
# Tests
7680

7781
.PHONY: lint
78-
lint: | $(BASE) $(GOLINT) ; $(info running golint...) @ ## Run golint
82+
lint: | $(BASE) $(GOLANGCI_LINT) ; $(info running golangci-lint...) @ ## Run golangci-lint
7983
$Q mkdir -p $(BASE)/test
8084
$Q cd $(BASE) && ret=0 && \
81-
test -z "$$($(GOLINT) run | tee $(BASE)/test/lint.out)" || ret=1 ; \
85+
test -z "$$($(GOLANGCI_LINT) run | tee $(BASE)/test/lint.out)" || ret=1 ; \
8286
cat $(BASE)/test/lint.out ; rm -rf $(BASE)/test ; \
8387
exit $$ret
8488

0 commit comments

Comments
 (0)