From e7f620f4c64bf3dc33070445fb9978ffa1e7f350 Mon Sep 17 00:00:00 2001 From: Gil Raphaelli Date: Tue, 16 Oct 2018 14:04:02 -0400 Subject: [PATCH] rely on go to resolve beats repo for goimports install (#8626) --- libbeat/scripts/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libbeat/scripts/Makefile b/libbeat/scripts/Makefile index 05f344f90381..79c0310a3dbb 100755 --- a/libbeat/scripts/Makefile +++ b/libbeat/scripts/Makefile @@ -48,7 +48,7 @@ TESTIFY_TOOL_REPO?=github.com/elastic/beats/vendor/github.com/stretchr/testify/a NOW=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ') GOBUILD_FLAGS?=-i -ldflags "-X github.com/elastic/beats/libbeat/version.buildTime=$(NOW) -X github.com/elastic/beats/libbeat/version.commit=$(COMMIT_ID)" GOIMPORTS=goimports -GOIMPORTS_REPO?=golang.org/x/tools/cmd/goimports +GOIMPORTS_REPO?=github.com/elastic/beats/vendor/golang.org/x/tools/cmd/goimports GOIMPORTS_LOCAL_PREFIX?=github.com/elastic GOLINT=golint GOLINT_REPO?=github.com/golang/lint/golint @@ -113,7 +113,7 @@ crosscompile: $(GOFILES) .PHONY: check check: check-headers python-env prepare-tests ## @build Checks project and source code if everything is according to standard @go vet ${GOPACKAGES} - @go get $(ES_BEATS)/vendor/$(GOIMPORTS_REPO) + @go get $(GOIMPORTS_REPO) @goimports -local ${GOIMPORTS_LOCAL_PREFIX} -l ${GOFILES_NOVENDOR} | (! grep .) || (echo "Code differs from goimports' style ^" && false) @${FIND} -name '*.py' -exec autopep8 -d --max-line-length 120 {} \; | (! grep . -q) || (echo "Code differs from autopep8's style" && false) @${FIND} -wholename "*tests/system/test_*.py" -perm ${PERM_EXEC} -exec false {} + || (echo "Python test files shouldn't be executable, otherwise nose doesn't find them" && false) @@ -135,7 +135,7 @@ endif .PHONY: fmt fmt: add-headers python-env ## @build Runs `goimports -l -w` and `autopep8`on the project's source code, modifying any files that do not match its style. - @go get $(ES_BEATS)/vendor/$(GOIMPORTS_REPO) + @go get $(GOIMPORTS_REPO) @goimports -local ${GOIMPORTS_LOCAL_PREFIX} -l -w ${GOFILES_NOVENDOR} @${FIND} -name '*.py' -exec ${PYTHON_ENV}/bin/autopep8 --in-place --max-line-length 120 {} \;