From 6d1612f8990e795698fc590c340a89341d1614e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 1 Mar 2020 12:23:23 +0100 Subject: [PATCH] Allow running lint (golangci-lint) using docker --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index b7fee8312..7f49be2b1 100755 --- a/Makefile +++ b/Makefile @@ -365,7 +365,11 @@ out/linters/golangci-lint-$(GOLINT_VERSION): # this one is meant for local use .PHONY: lint lint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go out/linters/golangci-lint-$(GOLINT_VERSION) ## Run lint +ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y) + docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:$(GOLINT_VERSION) golangci-lint run ${GOLINT_OPTIONS} ./... +else ./out/linters/golangci-lint-$(GOLINT_VERSION) run ${GOLINT_OPTIONS} ./... +endif # lint-ci is slower version of lint and is meant to be used in ci (travis) to avoid out of memory leaks. .PHONY: lint-ci -- GitLab