forked from emicklei/proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (61 loc) · 1.27 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
SRCS := $(shell find . -name '*.go')
BIN_DEPS := \
github.com/golang/lint/golint \
github.com/kisielk/errcheck \
honnef.co/go/tools/cmd/staticcheck \
honnef.co/go/tools/cmd/unused
.PHONY: all
all: test
.PHONY: deps
deps:
go get -d -v ./...
.PHONY: updatedeps
updatedeps:
go get -d -v -u -f ./...
.PHONY: bindeps
bindeps:
go get -v $(BIN_DEPS)
.PHONY: updatebindeps
updatebindeps:
go get -u -v $(BIN_DEPS)
.PHONY: testdeps
testdeps: bindeps
go get -d -v -t ./...
.PHONY: updatetestdeps
updatetestdeps: updatebindeps
go get -d -v -t -u -f ./...
.PHONY: install
install: deps
go install ./...
.PHONY: golint
golint: testdeps
@# TODO: readd cmd/proto2gql when fixed
@#for file in $(SRCS); do
for file in $(shell echo $(SRCS) | grep -v cmd/proto2gql); do \
golint $${file}; \
if [ -n "$$(golint $${file})" ]; then \
exit 1; \
fi; \
done
.PHONY: vet
vet: testdeps
go vet ./...
.PHONY: testdeps
errcheck: testdeps
errcheck ./...
.PHONY: staticcheck
staticcheck: testdeps
staticcheck ./...
.PHONY: unused
unused: testdeps
unused ./...
.PHONY: lint
# TODO: readd errcheck and unused when fixed
#lint: golint vet errcheck staticcheck unused
lint: golint vet staticcheck
.PHONY: test
test: testdeps lint
go test -race ./...
.PHONY: clean
clean:
go clean -i ./...