-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
60 lines (38 loc) · 856 Bytes
/
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
SHELL := /bin/bash
EXEDIR := cmd/mocrelay
TARGET := $(EXEDIR)/mocrelay
.PHONY: all
all:
$(MAKE) build
.PHONY: build
build: $(TARGET)
$(TARGET): $(shell find . -name \*.go)
cd $(EXEDIR) && go build
.PHONY: run
run: $(TARGET)
$(TARGET)
.PHONY: check
check:
test -z "$$(find . -name \*.go | xargs -P 8 -I {} golines -l {} 2>&1 | tee /dev/stderr)"
go vet ./...
staticcheck ./...
.PHONY: test
test:
GODEBUG=randautoseed=0 go test ./...
.PHONY: bench
bench:
GODEBUG=randautoseed=0 go test -bench . -benchmem
.PHONY: clean
clean:
$(RM) $(TARGET)
.PHONY: fmt
fmt:
find . -name \*.go | xargs -P 8 -I {} golines -w {}
.PHONY: githook
githook:
lefthook install
.PHONY: tool
tool:
go install github.com/segmentio/golines@latest
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest