Skip to content

Commit

Permalink
Limit the number of golangci-lint jobs to one
Browse files Browse the repository at this point in the history
If you want the old behaviour back, use:
e.g. make lint GOLINT_JOBS=`nproc`

Running multiple linters takes a lot of RAM.
And it only saves us like 15 seconds anyway ?
  • Loading branch information
afbjorklund committed Jul 23, 2019
1 parent e22b605 commit bb5736b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ KERNEL_VERSION ?= 4.16.14

GO_VERSION ?= $(shell go version | cut -d' ' -f3 | sed -e 's/go//')
GOLINT_VERSION ?= v1.17.1
# Limit number of default jobs, to avoid the CI builds running out of memory
GOLINT_JOBS ?= 1
export GO111MODULE := on

GOOS ?= $(shell go env GOOS)
Expand Down Expand Up @@ -276,6 +278,7 @@ out/linters/golangci-lint:
.PHONY: lint
lint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go out/linters/golangci-lint
./out/linters/golangci-lint run \
--concurrency ${GOLINT_JOBS} \
--deadline 4m \
--build-tags "${MINIKUBE_INTEGRATION_BUILD_TAGS}" \
--enable goimports,gocritic,golint,gocyclo,interfacer,misspell,nakedret,stylecheck,unconvert,unparam \
Expand Down

0 comments on commit bb5736b

Please sign in to comment.