-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (40 loc) · 1 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
GIT_DIR = $(shell git rev-parse --git-dir)
GOPATH = $(shell go env GOPATH)
GOBIN = $(GOPATH)/bin
TEST_ARGS = . ./app/...
install:
go install
install-tools:
go mod download
grep _ tools/tools.go | \
awk '{print $$2}' | \
xargs -tI % go install %
setup:
cp ./bin/pre-commit.sh $(GIT_DIR)/hooks/pre-commit
git config commit.template .commit-template
clean:
go mod tidy
go clean
build:
go build -o ./main
test:
go test $(TEST_ARGS)
test-c:
rm -rf ./coverage
mkdir -p ./coverage
gotest -v -cover -coverprofile ./coverage/cover.out $(TEST_ARGS)
go tool cover -html=./coverage/cover.out -o ./coverage/cover.html
open ./coverage/cover.html
lint: install-tools
go fmt $(TEST_ARGS)
go vet $(TEST_ARGS)
# honnef.co/go/tools/cmd/staticcheck
$(GOBIN)/staticcheck $(TEST_ARGS)
# $(GOBIN)/golint -set_exit_status $(TEST_ARGS)
ci: clean install-tools
go vet $(TEST_ARGS)
$(GOBIN)/staticcheck $(TEST_ARGS)
# $(GOBIN)/golint -set_exit_status $(TEST_ARGS)
go test -race $(TEST_ARGS)
release:
./bin/release.sh