-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
executable file
·37 lines (29 loc) · 1.12 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
.PHONY: lint test-cover test-cover-svg test-cover-html install-deps
.SILENT:
lint:
@#clear
@$(CURDIR)/bin/golangci-lint run -c .golangci.yaml --path-prefix . --fix
test:
@#clear
@go test --cover --coverprofile=coverage.out $(TEST_COVER_EXCLUDE_DIR) -count=1
test-cover:
@#clear
@go test --coverprofile=coverage.out $(TEST_COVER_EXCLUDE_DIR) > /dev/null
@go tool cover -func=coverage.out | grep total | grep -oE '[0-9]+(\.[0-9]+)?%'
test-cover-svg:
@#clear
@go test --coverprofile=coverage.out $(TEST_COVER_EXCLUDE_DIR) > /dev/null
@$(CURDIR)/bin/go-cover-treemap -coverprofile coverage.out > coverage.svg
@xdg-open ./coverage.svg
test-cover-html:
@#clear
@go test --coverprofile=coverage.out $(TEST_COVER_EXCLUDE_DIR) > /dev/null
@go tool cover -html="coverage.out"
install-deps:
@#clear
@GOBIN=$(CURDIR)/bin go install github.com/golangci/golangci-lint/cmd/[email protected]
@GOBIN=$(CURDIR)/bin go install github.com/nikolaydubina/[email protected]
@GOBIN=$(CURDIR)/bin go install golang.org/x/tools/cmd/godoc@latest
@go mod tidy
# ---------------
TEST_COVER_EXCLUDE_DIR := `go list ./... | grep -v -E 'cmd$$'`