-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
82 lines (59 loc) · 1.56 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
DIST_DIR ?= ./dist
PROG_NAME ?= limo
PACKAGES = $(shell go list ./...)
default: build
install: build
go install
build: check
go build
dist: macos linux windows
macos:
GOOS=darwin go build -o $(DIST_DIR)/macos/$(PROG_NAME)
linux:
GOOS=linux go build -o $(DIST_DIR)/linux/$(PROG_NAME)
windows:
GOOS=windows go build -o $(DIST_DIR)/windows/$(PROG_NAME).exe
check: vet lint errcheck interfacer aligncheck structcheck varcheck unconvert staticcheck vendorcheck prealloc test
vet:
go vet $(PACKAGES)
lint:
golint -set_exit_status $(PACKAGES)
errcheck:
errcheck -exclude errcheck_excludes.txt $(PACKAGES)
interfacer:
interfacer $(PACKAGES)
aligncheck:
aligncheck $(PACKAGES)
structcheck:
structcheck $(PACKAGES)
varcheck:
varcheck $(PACKAGES)
unconvert:
unconvert -v $(PACKAGES)
staticcheck:
staticcheck $(PACKAGES)
vendorcheck:
vendorcheck $(PACKAGES)
vendorcheck -u $(PACKAGES)
prealloc:
prealloc $(PACKAGES)
test:
go test -cover $(PACKAGES)
coverage:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES),\
go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out
clean:
go clean && rm -rf dist/*
deps:
go get -u github.com/alexkohler/prealloc
go get -u github.com/FiloSottile/vendorcheck
go get -u github.com/golang/dep/cmd/dep
go get -u golang.org/x/lint/golint
go get -u github.com/kisielk/errcheck
go get -u github.com/mdempsky/unconvert
go get -u github.com/opennota/check/...
go get -u honnef.co/go/tools/...
go get -u mvdan.cc/interfacer