diff --git a/.travis.yml b/.travis.yml index 0ed03f5..de743d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,4 +24,4 @@ jobs: on: tags: true api_key: - secure: "JHWc1VWTVL+vyKWN52N98tmgC4s0HbSRgtKg2K7ntWpD43c1dqLdZL0+LkZ60NMHM6scn3Uzg8pzb+5/5KcoDZQAfsSIsoB6xBwg/A2JP9REyiQvmmSmojTsgGswHGmwAkpRCWhzB6j2wQkjbUamxPX96EFcFxYiIG0Pci1oiV/QNHvvFyMpC3VaU4Z/x//yrvz+RgV2atyJ4M3UYTL1vovIFI2o7mH6cbESt/R3tSGDj3g9bHYeZp7cx5aszbYUCfixONhK5v4oV2s1diATO7btsG/TGvWzTmfrANRUsNcSl//zBRkgMy3HWsYqxwMIqwKasNtY6U+2sJVdQ1kbLwyYz5AIvwcaX8O2Ov6py2YjaF54YYjfbeyx0t4+663Hsg4FFQLWvWxbYxkM/FETYYOVND4057bkGis5dc01+sAEUoBIiAWFyS5SU6Sv9ELIuUsCOoxGxXHfKohfQY2Z+P7w5e26nAv10TF+LjdcnoPSNm9ro/Xm6gU2ioLWuZoqCIAleEQIgzA1nAnaBgioRkSLbVmnBUg5DyT/8btRHN+nMcJobvHcIrk62lUlocJAQ0Imlj4AMQHoIBt3t2mB5jHNdZ7R2coVf7HGIW06B5qjV92qtLUKjTWvBV5I6JfDhJZyjc/MCs/PEpMhzPnZOQWIOCmeDUkqGW0mWVZDKIY=" + secure: "M1A4gQy2/ToCdg3IIrhpzdttRB6FsPq1ohhzDMmXk7hAYqiZJgKvoU80rmRfpIrjqJxFLkX3zgRGCpZC7ifSQTv9AWMqdMnKHL8ALIHKYoxaOFi302G6jKShTlxvT3EGARikW1NNkxOUvO89LR8HQEs6Ee0Ej4U+srxR7qAj9PmwbcQELm8VuGyT6OwJCgTounaIHQIuS195g/Og0M5P5s/V8d80X9TvWHwYPa5G7mbcIjKW20QHYDczY9S/LznVFVN+9hd9EiszWVDRRhYN7N+Msgd/etlAp1Tk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coVf7HGIW06B5qjV92qtLUKjTWvBV5I6JfDhJZyjc/MCs/PEpMhzPnZOQWIOCmeDUkqGW0mWVZDKIY= +M1A4gQy2/ToCdg3IIrhpzdttRB6FsPq1ohhzDMmXk7hAYqiZJgKvoU80rmRfpIrjqJxFLkX3zgRGCpZC7ifSQTv9AWMqdMnKHL8ALIHKYoxaOFi302G6jKShTlxvT3EGARikW1NNkxOUvO89LR8HQEs6Ee0Ej4U+srxR7qAj9PmwbcQELm8VuGyT6OwJCgTounaIHQIuS195g/Og0M5P5s/V8d80X9TvWHwYPa5G7mbcIjKW20QHYDczY9S/LznVFVN+9hd9EiszWVDRRhYN7N+Msgd/etlAp1TkHZ4UsZKEpAIKHmks9Y/dg3WTIqgP/p9Dv6ddQ5tI4Zc9yAwaGyh5ToPAhJDZ+9UWFCkGOj/296rVCtykYa6pCYuLjdkHN9G2zDTQ1MgFuI+HDZVtIooGoCQIxepSeQYXX+l5mXurndqWf72JcRB2UFvN9336P4GjpUgpH6ml7r3bq00y2SNnBKEc6Nss4VWY1OLEGvYT6NJybmj0Wvqg0oAMvW6D8JnMg3nz4Kltzjvf39GkY8HHBpzCiav19kyDQxjKq6uR4F9eyfe5tficn3bLlwLX7RVUf7QZGVO/ZbidR2hw4ODZVcpXRsP0RC3hQVfi4EnR27fbDrRF0mqDmXMLOZjmrTwbz6d9mlNEpJwBqlXI1VrfXZIrPvDMJmHqDApR4YQ= diff --git a/basic.mk b/basic.mk index e9d4a86..61567b5 100644 --- a/basic.mk +++ b/basic.mk @@ -1,3 +1,6 @@ +# Set the shell +SHELL := /bin/bash + # Set an output prefix, which is the local directory if not specified PREFIX?=$(shell pwd) @@ -56,12 +59,16 @@ all: clean build fmt lint test staticcheck vet install ## Runs a clean, build, f .PHONY: fmt fmt: ## Verifies all files have been `gofmt`ed. @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 vendor | tee /dev/stderr)" ]]; then \ + exit 1; \ + fi .PHONY: lint lint: ## Verifies `golint` passes. @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 test: prebuild ## Runs the go tests. @@ -71,12 +78,16 @@ test: prebuild ## Runs the go tests. .PHONY: vet vet: ## Verifies `go vet` passes. @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 staticcheck: ## Verifies `staticcheck` passes. @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) | tee /dev/stderr)" ]]; then \ + exit 1; \ + fi .PHONY: cover cover: prebuild ## Runs go test with coverage. @@ -158,12 +169,12 @@ AUTHORS: .PHONY: vendor vendor: ## Updates the vendoring directory. - @$(RM) Gopkg.toml Gopkg.lock - @$(RM) go.mod go.sum + @$(RM) go.sum @$(RM) -r vendor - @GO111MODULE=on $(GO) mod init - @GO111MODULE=on $(GO) mod tidy - @GO111MODULE=on $(GO) mod vendor + GO111MODULE=on $(GO) mod init || true + GO111MODULE=on $(GO) mod tidy + GO111MODULE=on $(GO) mod vendor + @$(RM) Gopkg.toml Gopkg.lock .PHONY: clean clean: ## Cleanup any build binaries or packages.