Skip to content

Commit

Permalink
Remove DCO check from makefile, move to .travis.yml
Browse files Browse the repository at this point in the history
The DCO check is primarily only relevant as part of CI, so it
doesn't need to be in the Makefile. A contributor looking to
validate their commits can run script/validate/dco.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
  • Loading branch information
dnephin committed Jan 8, 2018
1 parent 1df6287 commit ebbcece
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
12 changes: 12 additions & 0 deletions script/validate/dco
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ebbcece

Please sign in to comment.