|
|
|
|
@ -61,7 +61,8 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_ |
|
|
|
|
SKIP_GOLANGCI_LINT :=
|
|
|
|
|
GOLANGCI_LINT :=
|
|
|
|
|
GOLANGCI_LINT_OPTS ?=
|
|
|
|
|
GOLANGCI_LINT_VERSION ?= v2.0.2
|
|
|
|
|
GOLANGCI_LINT_VERSION ?= v2.2.1
|
|
|
|
|
GOLANGCI_FMT_OPTS ?=
|
|
|
|
|
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
|
|
|
|
|
# windows isn't included here because of the path separator being different.
|
|
|
|
|
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) |
|
|
|
|
@ -138,7 +139,7 @@ common-deps: |
|
|
|
|
update-go-deps: |
|
|
|
|
@echo ">> updating Go dependencies"
|
|
|
|
|
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
|
|
|
|
|
$(GO) get -d $$m; \
|
|
|
|
|
$(GO) get $$m; \
|
|
|
|
|
done
|
|
|
|
|
$(GO) mod tidy
|
|
|
|
|
|
|
|
|
|
@ -156,9 +157,13 @@ $(GOTEST_DIR): |
|
|
|
|
@mkdir -p $@
|
|
|
|
|
|
|
|
|
|
.PHONY: common-format |
|
|
|
|
common-format: |
|
|
|
|
common-format: $(GOLANGCI_LINT) |
|
|
|
|
@echo ">> formatting code"
|
|
|
|
|
$(GO) fmt $(pkgs)
|
|
|
|
|
ifdef GOLANGCI_LINT |
|
|
|
|
@echo ">> formatting code with golangci-lint"
|
|
|
|
|
$(GOLANGCI_LINT) fmt $(GOLANGCI_FMT_OPTS)
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
.PHONY: common-vet |
|
|
|
|
common-vet: |
|
|
|
|
@ -248,8 +253,8 @@ $(PROMU): |
|
|
|
|
cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
|
|
|
|
|
rm -r $(PROMU_TMP)
|
|
|
|
|
|
|
|
|
|
.PHONY: proto |
|
|
|
|
proto: |
|
|
|
|
.PHONY: common-proto |
|
|
|
|
common-proto: |
|
|
|
|
@echo ">> generating code from proto files"
|
|
|
|
|
@./scripts/genproto.sh
|
|
|
|
|
|
|
|
|
|
|