1 PACKAGES := $(shell glide nv)
2 # Many Go tools take file globs or directories as arguments instead of packages.
6 # The linting tools evolve with each Go version, so run them only on the latest
8 GO_VERSION := $(shell go version | cut -d " " -f 3)
9 GO_MINOR_VERSION := $(word 2,$(subst ., ,$(GO_VERSION)))
10 LINTABLE_MINOR_VERSIONS := 7 8
11 ifneq ($(filter $(LINTABLE_MINOR_VERSIONS),$(GO_MINOR_VERSION)),)
16 export GO15VENDOREXPERIMENT=1
21 go build -i $(PACKAGES)
26 glide --version || go get github.com/Masterminds/glide
32 go test -cover -race $(PACKAGES)
37 go get github.com/wadey/gocovmerge
38 go get github.com/mattn/goveralls
39 go get golang.org/x/tools/cmd/cover
41 go get github.com/golang/lint/golint
48 @echo "Checking formatting..."
49 @gofmt -d -s $(PACKAGE_FILES) 2>&1 | tee lint.log
50 @echo "Checking vet..."
51 @$(foreach dir,$(PACKAGE_FILES),go tool vet $(dir) 2>&1 | tee -a lint.log;)
52 @echo "Checking lint..."
53 @$(foreach dir,$(PKGS),golint $(dir) 2>&1 | tee -a lint.log;)
54 @echo "Checking for unresolved FIXMEs..."
55 @git grep -i fixme | grep -v -e vendor -e Makefile | tee -a lint.log
58 @echo "Skipping linters on" $(GO_VERSION)
63 test_ci: install_ci build
64 ./scripts/cover.sh $(shell go list $(PACKAGES))