Skip to content

Commit

Permalink
rely on go to resolve beats repo for goimports install (elastic#8626)
Browse files Browse the repository at this point in the history
  • Loading branch information
graphaelli authored and ruflin committed Oct 16, 2018
1 parent 7ef3c3b commit e7f620f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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 {} \;

Expand Down

0 comments on commit e7f620f

Please sign in to comment.