-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
51 lines (39 loc) · 1.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
GO := go
GINKGO := ginkgo
GOMETALINTER := gometalinter.v2
GOVENDOR := dep
GOTOOLS = github.com/onsi/ginkgo/ginkgo \
github.com/onsi/gomega \
github.com/golang/dep/cmd/dep \
gopkg.in/alecthomas/gometalinter.v2
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
all: deps format vet lint test
tools:
@echo ">> ensuring tools are installed"
@- $(foreach GOTOOL,$(GOTOOLS), \
$(GO) get $(GOTOOL) ; \
)
tools-update:
@echo ">> updating tools"
@- $(foreach GOTOOL,$(GOTOOLS), \
$(GO) get -u $(GOTOOL) ; \
)
deps: tools
@echo ">> (re)installing deps"
@$(GOVENDOR) ensure
format:
@echo ">> formatting code"
@$(GO) fmt $(pkgs)
vet:
@echo ">> vetting code"
@$(GO) vet $(pkgs)
lint:
@echo ">> checking code style"
@$(GOMETALINTER) --config=./.gometalinter.json $(pkgs)
test:
@echo ">> running tests"
@$(GO) version
@$(GINKGO) version
@$(GINKGO) -r --randomizeAllSpecs --randomizeSuites --failOnPending --cover --trace --race --compilers=2 .
@$(GO) tool cover -html ip2proxy.coverprofile -o cover.html
.PHONY: all