diff options
Diffstat (limited to 'vendor/go.uber.org/atomic/Makefile')
-rw-r--r-- | vendor/go.uber.org/atomic/Makefile | 73 |
1 files changed, 22 insertions, 51 deletions
diff --git a/vendor/go.uber.org/atomic/Makefile b/vendor/go.uber.org/atomic/Makefile index dfc63d9..39af0fb 100644 --- a/vendor/go.uber.org/atomic/Makefile +++ b/vendor/go.uber.org/atomic/Makefile | |||
@@ -1,64 +1,35 @@ | |||
1 | PACKAGES := $(shell glide nv) | 1 | # Directory to place `go install`ed binaries into. |
2 | # Many Go tools take file globs or directories as arguments instead of packages. | 2 | export GOBIN ?= $(shell pwd)/bin |
3 | PACKAGE_FILES ?= *.go | ||
4 | 3 | ||
4 | GOLINT = $(GOBIN)/golint | ||
5 | 5 | ||
6 | # The linting tools evolve with each Go version, so run them only on the latest | 6 | GO_FILES ?= *.go |
7 | # stable release. | ||
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)),) | ||
12 | SHOULD_LINT := true | ||
13 | endif | ||
14 | |||
15 | |||
16 | export GO15VENDOREXPERIMENT=1 | ||
17 | |||
18 | 7 | ||
19 | .PHONY: build | 8 | .PHONY: build |
20 | build: | 9 | build: |
21 | go build -i $(PACKAGES) | 10 | go build ./... |
22 | |||
23 | |||
24 | .PHONY: install | ||
25 | install: | ||
26 | glide --version || go get github.com/Masterminds/glide | ||
27 | glide install | ||
28 | |||
29 | 11 | ||
30 | .PHONY: test | 12 | .PHONY: test |
31 | test: | 13 | test: |
32 | go test -cover -race $(PACKAGES) | 14 | go test -race ./... |
33 | 15 | ||
16 | .PHONY: gofmt | ||
17 | gofmt: | ||
18 | $(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX)) | ||
19 | gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true | ||
20 | @[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" && cat $(FMT_LOG) && false) | ||
34 | 21 | ||
35 | .PHONY: install_ci | 22 | $(GOLINT): |
36 | install_ci: install | 23 | go install golang.org/x/lint/golint |
37 | go get github.com/wadey/gocovmerge | ||
38 | go get github.com/mattn/goveralls | ||
39 | go get golang.org/x/tools/cmd/cover | ||
40 | ifdef SHOULD_LINT | ||
41 | go get github.com/golang/lint/golint | ||
42 | endif | ||
43 | 24 | ||
44 | .PHONY: lint | 25 | .PHONY: golint |
45 | lint: | 26 | golint: $(GOLINT) |
46 | ifdef SHOULD_LINT | 27 | $(GOLINT) ./... |
47 | @rm -rf lint.log | ||
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 | ||
56 | @[ ! -s lint.log ] | ||
57 | else | ||
58 | @echo "Skipping linters on" $(GO_VERSION) | ||
59 | endif | ||
60 | 28 | ||
29 | .PHONY: lint | ||
30 | lint: gofmt golint | ||
61 | 31 | ||
62 | .PHONY: test_ci | 32 | .PHONY: cover |
63 | test_ci: install_ci build | 33 | cover: |
64 | ./scripts/cover.sh $(shell go list $(PACKAGES)) | 34 | go test -coverprofile=cover.out -coverpkg ./... -v ./... |
35 | go tool cover -html=cover.out -o cover.html | ||