diff --git a/.travis.yml b/.travis.yml index b4c833f4f..70dce7956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ install: script: - export GOOS=$TRAVIS_GOOS - export CGO_ENABLED=$TRAVIS_CGO_ENABLED - - GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco + - DCO_VERBOSITY=-q script/validate/dco - GOOS=linux script/setup/install-dev-tools - go build -i . - make check diff --git a/Makefile b/Makefile index 2d08430cb..20e3f8d74 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ endif TESTFLAGS ?= -v $(TESTFLAGS_RACE) TESTFLAGS_PARALLEL ?= 8 -.PHONY: clean all AUTHORS fmt vet lint dco build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release +.PHONY: clean all AUTHORS build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release .DEFAULT: default all: binaries @@ -106,14 +106,6 @@ proto-fmt: ## check format of proto files @test -z "$$(find . -path ./vendor -prune -o -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \ (echo "$(ONI) meta fields in proto files must have option (gogoproto.nullable) = false" && false) -dco: ## dco check - @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found" && false) -ifdef TRAVIS_COMMIT_RANGE - git-validation -q -run DCO,short-subject,dangling-whitespace -else - git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD -endif - build: ## build the go packages @echo "$(WHALE) $@" @go build ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${GO_GCFLAGS} ${PACKAGES} diff --git a/script/validate/dco b/script/validate/dco new file mode 100755 index 000000000..a4c600085 --- /dev/null +++ b/script/validate/dco @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +if ! command -v git-validation; then + >&2 echo "ERROR: git-validation not found. Install with:" + >&2 echo " go get -u github.com/vbatts/git-validation" + exit 1 +fi + +GIT_CHECK_EXCLUDE="./vendor" +verbosity="${DCO_VERBOSITY--v}" +git-validation "$verbosity" -run DCO,short-subject,dangling-whitespace