Merge pull request #1976 from dnephin/move-dco-validation-out-of-makefile

Remove DCO check from makefile
This commit is contained in:
Michael Crosby 2018-01-09 09:27:44 -05:00 committed by GitHub
commit b509e78578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View File

@ -51,7 +51,7 @@ install:
script: script:
- export GOOS=$TRAVIS_GOOS - export GOOS=$TRAVIS_GOOS
- export CGO_ENABLED=$TRAVIS_CGO_ENABLED - 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 - GOOS=linux script/setup/install-dev-tools
- go build -i . - go build -i .
- make check - make check

View File

@ -65,7 +65,7 @@ endif
TESTFLAGS ?= -v $(TESTFLAGS_RACE) TESTFLAGS ?= -v $(TESTFLAGS_RACE)
TESTFLAGS_PARALLEL ?= 8 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 .DEFAULT: default
all: binaries 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)" || \ @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) (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 build: ## build the go packages
@echo "$(WHALE) $@" @echo "$(WHALE) $@"
@go build ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${GO_GCFLAGS} ${PACKAGES} @go build ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${GO_GCFLAGS} ${PACKAGES}

12
script/validate/dco Executable file
View File

@ -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