-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (47 loc) · 1.65 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
52
53
54
55
56
57
58
59
###################### PlayNet Makefile ######################
#
# This Makefile is intended to be used with go libraries being
# no subject to builds and therefor only contains tests
#
.PHONY: build
### MAIN STEPS ###
all: test check
# install required tools and dependencies
deps:
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/golang/lint/golint
go get -u github.com/haya14busa/goverage
go get -u github.com/kisielk/errcheck
go get -u github.com/maxbrunsfeld/counterfeiter
go get -u github.com/onsi/ginkgo/ginkgo
go get -u github.com/onsi/gomega
go get -u github.com/schrej/godacov
go get -u golang.org/x/tools/cmd/goimports
# test entire repo
test:
@go test -cover -race $(shell go list ./... | grep -v /vendor/)
# format entire repo (excluding vendor)
format:
@go get golang.org/x/tools/cmd/goimports
@find . -type f -name '*.go' -not -path './vendor/*' -exec gofmt -w "{}" +
@find . -type f -name '*.go' -not -path './vendor/*' -exec goimports -w "{}" +
# go quality checks
check: format lint vet
# vet entire repo (excluding vendor)
vet:
@go vet $(shell go list ./... | grep -v /vendor/)
# lint entire repo (excluding vendor)
lint:
@go get github.com/golang/lint/golint
@golint -min_confidence 1 $(shell go list ./... | grep -v /vendor/)
# errcheck entire repo (excluding vendor)
errcheck:
@go get github.com/kisielk/errcheck
@errcheck -ignore '(Close|Write)' $(shell go list ./... | grep -v /vendor/)
cover:
@go get github.com/haya14busa/goverage
@go get github.com/schrej/godacov
goverage -v -coverprofile=coverage.out $(shell go list ./... | grep -v /vendor/)
generate:
@go get github.com/maxbrunsfeld/counterfeiter
@go generate ./...