From d79f6794dafbe902750702ef0fd28f29541eadfa Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Tue, 21 Nov 2023 20:01:08 -0800 Subject: [PATCH] [chore] add gogci and gci make targets (#28879) add gogci action at top level, and gci action at component level to run gci --- Makefile | 4 ++++ Makefile.Common | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index e6c40f8d8f0be..c2a1716b0b7db 100644 --- a/Makefile +++ b/Makefile @@ -88,6 +88,10 @@ stability-tests: otelcontribcol @echo Stability tests are disabled until we have a stable performance environment. @echo To enable the tests replace this echo by $(MAKE) -C testbed run-stability-tests +.PHONY: gogci +gogci: + $(MAKE) $(FOR_GROUP_TARGET) TARGET="gci" + .PHONY: gotidy gotidy: $(MAKE) $(FOR_GROUP_TARGET) TARGET="tidy" diff --git a/Makefile.Common b/Makefile.Common index 2a147324a8471..248623af25cd9 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -68,6 +68,7 @@ CROSSLINK := $(TOOLS_BIN_DIR)/crosslink GOJUNIT := $(TOOLS_BIN_DIR)/go-junit-report BUILDER := $(TOOLS_BIN_DIR)/builder GOVULNCHECK := $(TOOLS_BIN_DIR)/govulncheck +GCI := $(TOOLS_BIN_DIR)/gci # BUILD_TYPE should be one of (dev, release). BUILD_TYPE?=release @@ -197,3 +198,8 @@ misspell-correction: $(TOOLS_BIN_DIR)/misspell .PHONY: moddownload moddownload: $(GOCMD) mod download + +.PHONY: gci +gci: $(TOOLS_BIN_DIR)/gci + @echo "running $(GCI)" + @$(GCI) write -s standard -s default -s "prefix(github.com/open-telemetry/opentelemetry-collector-contrib)" $(ALL_SRC_AND_DOC)