Skip to content

Commit

Permalink
chore: allow lint to be run in container locally (grafana#12277)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney authored and edsoncelio committed Mar 22, 2024
1 parent 0e03a02 commit 6109a15
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down

0 comments on commit 6109a15

Please sign in to comment.