aboutsummaryrefslogtreecommitdiff
path: root/vendor/go.uber.org/atomic/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.uber.org/atomic/Makefile')
-rw-r--r--vendor/go.uber.org/atomic/Makefile73
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 @@
1PACKAGES := $(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. 2export GOBIN ?= $(shell pwd)/bin
3PACKAGE_FILES ?= *.go
4 3
4GOLINT = $(GOBIN)/golint
5 5
6# The linting tools evolve with each Go version, so run them only on the latest 6GO_FILES ?= *.go
7# stable release.
8GO_VERSION := $(shell go version | cut -d " " -f 3)
9GO_MINOR_VERSION := $(word 2,$(subst ., ,$(GO_VERSION)))
10LINTABLE_MINOR_VERSIONS := 7 8
11ifneq ($(filter $(LINTABLE_MINOR_VERSIONS),$(GO_MINOR_VERSION)),)
12SHOULD_LINT := true
13endif
14
15
16export GO15VENDOREXPERIMENT=1
17
18 7
19.PHONY: build 8.PHONY: build
20build: 9build:
21 go build -i $(PACKAGES) 10 go build ./...
22
23
24.PHONY: install
25install:
26 glide --version || go get github.com/Masterminds/glide
27 glide install
28
29 11
30.PHONY: test 12.PHONY: test
31test: 13test:
32 go test -cover -race $(PACKAGES) 14 go test -race ./...
33 15
16.PHONY: gofmt
17gofmt:
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):
36install_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
40ifdef SHOULD_LINT
41 go get github.com/golang/lint/golint
42endif
43 24
44.PHONY: lint 25.PHONY: golint
45lint: 26golint: $(GOLINT)
46ifdef 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 ]
57else
58 @echo "Skipping linters on" $(GO_VERSION)
59endif
60 28
29.PHONY: lint
30lint: gofmt golint
61 31
62.PHONY: test_ci 32.PHONY: cover
63test_ci: install_ci build 33cover:
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