From 6109a15a67477550af3a7c14f2c9a114f94cc7f9 Mon Sep 17 00:00:00 2001 From: Trevor Whitney Date: Wed, 20 Mar 2024 11:44:27 -0600 Subject: [PATCH] chore: allow lint to be run in container locally (#12277) --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 07aaf9c58d8c..c841a2676c2b 100644 --- a/Makefile +++ b/Makefile @@ -315,10 +315,17 @@ publish: packages # To run this efficiently on your workstation, run this from the root dir: # docker run --rm --tty -i -v $(pwd)/.cache:/go/cache -v $(pwd)/.pkg:/go/pkg -v $(pwd):/src/loki grafana/loki-build-image:0.24.1 lint lint: ## run linters +ifeq ($(BUILD_IN_CONTAINER),true) + $(SUDO) docker run $(RM) $(TTY) -i \ + -v $(shell go env GOPATH)/pkg:/go/pkg$(MOUNT_FLAGS) \ + -v $(shell pwd):/src/loki$(MOUNT_FLAGS) \ + $(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) $@; +else go version golangci-lint version GO111MODULE=on golangci-lint run -v --timeout 15m faillint -paths "sync/atomic=go.uber.org/atomic" ./... +endif ######## # Test #