update travis

Signed-off-by: Jess Frazelle <acidburn@jessfraz.com>
This commit is contained in:
Jess Frazelle 2019-05-25 16:55:09 -04:00
parent e08afe0ff7
commit 66e393036f
3 changed files with 18 additions and 8 deletions

View file

@ -3,7 +3,7 @@ sudo: required
services: services:
- docker - docker
go: go:
- 1.10.x - 1.11.x
before_install: before_install:
- go get golang.org/x/lint/golint - go get golang.org/x/lint/golint
- go get honnef.co/go/tools/cmd/staticcheck - go get honnef.co/go/tools/cmd/staticcheck

View file

@ -1,3 +1,6 @@
# Set the shell
SHELL := /bin/bash
# Set an output prefix, which is the local directory if not specified # Set an output prefix, which is the local directory if not specified
PREFIX?=$(shell pwd) PREFIX?=$(shell pwd)
@ -56,12 +59,16 @@ all: clean build fmt lint test staticcheck vet install ## Runs a clean, build, f
.PHONY: fmt .PHONY: fmt
fmt: ## Verifies all files have been `gofmt`ed. fmt: ## Verifies all files have been `gofmt`ed.
@echo "+ $@" @echo "+ $@"
@gofmt -s -l . | grep -v '.pb.go:' | grep -v vendor | tee /dev/stderr @if [[ ! -z "$(shell gofmt -s -l . | grep -v '.pb.go' | grep -v '.twirp.go' | grep -v 'bindata.go' | grep -v vendor | tee /dev/stderr)" ]]; then \
exit 1; \
fi
.PHONY: lint .PHONY: lint
lint: ## Verifies `golint` passes. lint: ## Verifies `golint` passes.
@echo "+ $@" @echo "+ $@"
@golint ./... | grep -v '.pb.go:' | grep -v vendor | tee /dev/stderr @if [[ ! -z "$(shell golint ./... | grep -v '.pb.go:' | grep -v '.twirp.go:' | grep -v vendor | tee /dev/stderr)" ]]; then \
exit 1; \
fi
.PHONY: test .PHONY: test
test: prebuild ## Runs the go tests. test: prebuild ## Runs the go tests.
@ -71,12 +78,16 @@ test: prebuild ## Runs the go tests.
.PHONY: vet .PHONY: vet
vet: ## Verifies `go vet` passes. vet: ## Verifies `go vet` passes.
@echo "+ $@" @echo "+ $@"
@$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr @if [[ ! -z "$(shell $(GO) vet $(shell $(GO) list ./... | grep -v vendor) | tee /dev/stderr)" ]]; then \
exit 1; \
fi
.PHONY: staticcheck .PHONY: staticcheck
staticcheck: ## Verifies `staticcheck` passes. staticcheck: ## Verifies `staticcheck` passes.
@echo "+ $@" @echo "+ $@"
@staticcheck $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr @if [[ ! -z "$(shell staticcheck $(shell $(GO) list ./... | grep -v vendor) | grep -v 'bindata.go:' | tee /dev/stderr)" ]]; then \
exit 1; \
fi
.PHONY: cover .PHONY: cover
cover: prebuild ## Runs go test with coverage. cover: prebuild ## Runs go test with coverage.

View file

@ -26,7 +26,6 @@ var (
file string file string
dir string dir string
shortpath string
) )
func init() { func init() {