-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (22 loc) · 830 Bytes
/
Makefile
File metadata and controls
31 lines (22 loc) · 830 Bytes
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
SOURCE_FILES?=$$(go list ./... | grep -v /vendor/ | grep -v /mocks/)
TEST_PATTERN?=.
TEST_OPTIONS?=-race -v
setup:
go get -u github.com/alecthomas/gometalinter
go get -u golang.org/x/tools/cmd/cover
go get -u github.com/dave/courtney
gometalinter --install --update
test:
echo 'mode: atomic' > coverage.txt && go list ./... | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.txt' && rm coverage.tmp
cover: test
go tool cover -html=coverage.txt
fmt:
goimports -w .
lint:
golangci-lint run --enable-all --disable lll --disable interfacer
ci: lint test
critic:
gocritic check-project .
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := build