diff --git a/Makefile b/Makefile index 7637549411493..1141623fe60d3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .DEFAULT_GOAL := all -.PHONY: all images check-generated-files logcli loki loki-debug promtail promtail-debug loki-canary lint test clean yacc protos touch-protobuf-sources touch-protos +.PHONY: all images check-generated-files logcli loki loki-debug promtail promtail-debug loki-canary lint test clean yacc protos touch-protobuf-sources touch-protos format .PHONY: docker-driver docker-driver-clean docker-driver-enable docker-driver-push .PHONY: fluent-bit-image, fluent-bit-push, fluent-bit-test .PHONY: fluentd-image, fluentd-push, fluentd-test @@ -627,3 +627,9 @@ endif test-fuzz: go test -timeout 30s -tags dev,gofuzz -cpuprofile cpu.prof -memprofile mem.prof \ -run ^Test_Fuzz$$ github.com/grafana/loki/pkg/logql -v -count=1 -timeout=0s + +format: + find . $(DONT_FIND) -name '*.pb.go' -prune -o -name '*.y.go' -prune -o -name '*.rl.go' -prune -o \ + -type f -name '*.go' -exec gofmt -w -s {} \; + find . $(DONT_FIND) -name '*.pb.go' -prune -o -name '*.y.go' -prune -o -name '*.rl.go' -prune -o \ + -type f -name '*.go' -exec goimports -w -local github.com/grafana/loki {} \;