2017-07-31 16:11:42 +02:00
|
|
|
all: check test integration-test
|
2017-07-21 15:13:09 +02:00
|
|
|
|
|
|
|
|
.PHONY: check
|
2018-05-22 14:47:43 +02:00
|
|
|
check: .check-fmt .check-vet .check-lint .check-ineffassign .check-mega .check-misspell
|
2017-09-21 21:33:43 +02:00
|
|
|
|
|
|
|
|
.PHONY: .check-fmt
|
|
|
|
|
.check-fmt:
|
|
|
|
|
@gofmt -s -l . | ifne false
|
|
|
|
|
|
|
|
|
|
.PHONY: .check-vet
|
|
|
|
|
.check-vet:
|
|
|
|
|
@go vet ./...
|
|
|
|
|
|
|
|
|
|
.PHONY: .check-lint
|
|
|
|
|
.check-lint:
|
|
|
|
|
@golint -set_exit_status ./...
|
|
|
|
|
|
|
|
|
|
.PHONY: .check-ineffassign
|
|
|
|
|
.check-ineffassign:
|
|
|
|
|
@ineffassign .
|
2017-07-21 15:13:09 +02:00
|
|
|
|
2018-05-22 14:47:43 +02:00
|
|
|
.PHONY: .check-mega
|
|
|
|
|
.check-mega:
|
|
|
|
|
@megacheck ./...
|
|
|
|
|
|
|
|
|
|
.PHONY: .check-misspell
|
|
|
|
|
.check-misspell:
|
|
|
|
|
@misspell ./...
|
|
|
|
|
|
2017-07-21 15:13:09 +02:00
|
|
|
.PHONY: test
|
|
|
|
|
test:
|
2017-09-21 21:33:43 +02:00
|
|
|
@go test -cover -race ./...
|
2017-07-31 16:11:42 +02:00
|
|
|
|
|
|
|
|
.PHONY: integration-test
|
|
|
|
|
integration-test:
|
2017-09-21 21:33:43 +02:00
|
|
|
@go test -cover -tags integration .
|
2017-07-21 15:13:09 +02:00
|
|
|
|
|
|
|
|
.PHONY: get-deps
|
|
|
|
|
get-deps:
|
|
|
|
|
go get -t ./...
|
|
|
|
|
|
2018-05-22 14:47:43 +02:00
|
|
|
ifndef GOBIN
|
|
|
|
|
export GOBIN := $(GOPATH)/bin
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
.PHONY: get-tools
|
|
|
|
|
get-tools: GOPATH := $(shell mktemp -d)
|
|
|
|
|
get-tools:
|
|
|
|
|
@echo "==> Installing tools at $(GOBIN)..."
|
|
|
|
|
@mkdir -p $(GOBIN)
|
|
|
|
|
|
|
|
|
|
@go get -u github.com/golang/lint/golint
|
|
|
|
|
@go get -u github.com/client9/misspell/cmd/misspell
|
|
|
|
|
@go get -u github.com/gordonklaus/ineffassign
|
|
|
|
|
@go get -u honnef.co/go/tools/cmd/megacheck
|
|
|
|
|
|
|
|
|
|
@rm -Rf $(GOPATH)
|