-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 1.24 KB
/
Makefile
File metadata and controls
53 lines (39 loc) · 1.24 KB
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
.PHONY: all test lint vet fmt travis coverage checkfmt prepare updep
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
PKGSDIRS=$(shell find -L . -type f -name "*.go" -not -path "./Godeps/*")
all: test vet checkfmt
travis: test checkfmt vet coverage
prepare: updep fmt test vet checkfmt
test:
@echo "$(OK_COLOR)Test packages$(NO_COLOR)"
@go test -v ./...
coverage:
@echo "$(OK_COLOR)Make coverage report$(NO_COLOR)"
@./coverage.sh
-goveralls -coverprofile=gover.coverprofile -service=travis-ci
lint:
@echo "$(OK_COLOR)Run lint$(NO_COLOR)"
test -z "$$(golint ./... | grep -v Godeps/_workspace/src/ | tee /dev/stderr)"
vet:
@echo "$(OK_COLOR)Run vet$(NO_COLOR)"
@go vet ./...
checkfmt:
@echo "$(OK_COLOR)Check formats$(NO_COLOR)"
@./checkfmt.sh .
fmt:
@echo "$(OK_COLOR)Formatting$(NO_COLOR)"
@echo $(PKGSDIRS) | xargs -I '{p}' -n1 goimports -w {p}
tools:
@echo "$(OK_COLOR)Install tools$(NO_COLOR)"
go get github.com/tools/godep
go get golang.org/x/tools/cmd/goimports
go get github.com/golang/lint
updep:
@echo "$(OK_COLOR)Update dependencies$(NO_COLOR)"
GOOS=linux godep save ./...
GOOS=linux godep update github.com/...
GOOS=linux godep update gopkg.in/...
GOOS=linux godep update golang.org/...