Skip to content

Commit

Permalink
Synchronize common files from prometheus/prometheus (#83)
Browse files Browse the repository at this point in the history
* Update common Prometheus files

Signed-off-by: prombot <[email protected]>

* Added format command.

Signed-off-by: bwplotka <[email protected]>

---------

Signed-off-by: prombot <[email protected]>
Signed-off-by: bwplotka <[email protected]>
Co-authored-by: bwplotka <[email protected]>
  • Loading branch information
prombot and bwplotka authored Oct 1, 2024
1 parent c9754d0 commit b2a914a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,21 @@ DOCKER_REPO ?= prometheuscommunity

include Makefile.common

DOCKER_IMAGE_NAME ?= avalanche
DOCKER_IMAGE_NAME ?= avalanche

GOIMPORTS = goimports
$(GOIMPORTS):
@go install golang.org/x/tools/cmd/goimports@latest

GOFUMPT = gofumpt
$(GOFUMPT):
@go install mvdan.cc/gofumpt@latest

GO_FILES = $(shell find . -path ./vendor -prune -o -name '*.go' -print)

.PHONY: format
format: $(GOFUMPT) $(GOIMPORTS)
@echo ">> formating imports)"
@$(GOIMPORTS) -local github.com/prometheus-community/avalanche -w $(GO_FILES)
@echo ">> gofumpt-ing the code; golangci-lint requires this"
@$(GOFUMPT) -extra -w $(GO_FILES)
6 changes: 6 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,9 @@ $(1)_precheck:
exit 1; \
fi
endef

govulncheck: install-govulncheck
govulncheck ./...

install-govulncheck:
command -v govulncheck > /dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest

0 comments on commit b2a914a

Please sign in to comment.