travis: add go1.6 and work around golint
closes #350 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
e23fbbb408
commit
54cd96d2fb
|
@ -1,5 +1,6 @@
|
|||
language: go
|
||||
go:
|
||||
- 1.6
|
||||
- 1.5.3
|
||||
- 1.4.3
|
||||
- 1.3.3
|
||||
|
@ -8,13 +9,13 @@ sudo: false
|
|||
|
||||
before_install:
|
||||
- go get golang.org/x/tools/cmd/vet
|
||||
- go get github.com/golang/lint/golint
|
||||
- go version | (grep -q 'go1.[56]' || exit 0 && go get -u github.com/golang/lint/golint )
|
||||
- go get github.com/vbatts/git-validation
|
||||
|
||||
install: true
|
||||
|
||||
script:
|
||||
- go vet -x ./...
|
||||
- $HOME/gopath/bin/golint ./...
|
||||
- make .golint
|
||||
- $HOME/gopath/bin/git-validation -run DCO,short-subject -v -range ${TRAVIS_COMMIT_RANGE}
|
||||
|
||||
|
|
8
Makefile
8
Makefile
|
@ -40,6 +40,11 @@ html:
|
|||
vbatts/pandoc -f markdown_github -t html5 -o /output/docs.html $(patsubst %,/input/%,$(DOC_FILES)) && \
|
||||
ls -sh $(shell readlink -f output/docs.html)
|
||||
|
||||
|
||||
HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-)
|
||||
# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked.
|
||||
ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' == '$(1)' && echo 'true')
|
||||
|
||||
.PHONY: test .govet .golint .gitvalidation
|
||||
|
||||
test: .govet .golint .gitvalidation
|
||||
|
@ -50,7 +55,10 @@ test: .govet .golint .gitvalidation
|
|||
|
||||
# `go get github.com/golang/lint/golint`
|
||||
.golint:
|
||||
ifeq ($(call ALLOWED_GO_VERSION,1.5,$(HOST_GOLANG_VERSION)),true)
|
||||
golint ./...
|
||||
endif
|
||||
|
||||
|
||||
# `go get github.com/vbatts/git-validation`
|
||||
.gitvalidation:
|
||||
|
|
Loading…
Reference in New Issue