X Tutup
Skip to content

Commit ebbcece

Browse files
committed
Remove DCO check from makefile, move to .travis.yml
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>
1 parent 1df6287 commit ebbcece

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ install:
5151
script:
5252
- export GOOS=$TRAVIS_GOOS
5353
- export CGO_ENABLED=$TRAVIS_CGO_ENABLED
54-
- GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco
54+
- DCO_VERBOSITY=-q script/validate/dco
5555
- GOOS=linux script/setup/install-dev-tools
5656
- go build -i .
5757
- make check

Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ endif
6565
TESTFLAGS ?= -v $(TESTFLAGS_RACE)
6666
TESTFLAGS_PARALLEL ?= 8
6767

68-
.PHONY: clean all AUTHORS fmt vet lint dco build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release
68+
.PHONY: clean all AUTHORS build binaries test integration generate protos checkprotos coverage ci check help install uninstall vendor release
6969
.DEFAULT: default
7070

7171
all: binaries
@@ -106,14 +106,6 @@ proto-fmt: ## check format of proto files
106106
@test -z "$$(find . -path ./vendor -prune -o -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \
107107
(echo "$(ONI) meta fields in proto files must have option (gogoproto.nullable) = false" && false)
108108

109-
dco: ## dco check
110-
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found" && false)
111-
ifdef TRAVIS_COMMIT_RANGE
112-
git-validation -q -run DCO,short-subject,dangling-whitespace
113-
else
114-
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
115-
endif
116-
117109
build: ## build the go packages
118110
@echo "$(WHALE) $@"
119111
@go build ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${GO_LDFLAGS} ${GO_GCFLAGS} ${PACKAGES}

script/validate/dco

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -eu -o pipefail
3+
4+
if ! command -v git-validation; then
5+
>&2 echo "ERROR: git-validation not found. Install with:"
6+
>&2 echo " go get -u github.com/vbatts/git-validation"
7+
exit 1
8+
fi
9+
10+
GIT_CHECK_EXCLUDE="./vendor"
11+
verbosity="${DCO_VERBOSITY--v}"
12+
git-validation "$verbosity" -run DCO,short-subject,dangling-whitespace

0 commit comments

Comments
 (0)
X Tutup