-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (18 loc) · 868 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
.PHONY: dox test vet check cover tidy
help: ## Show help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-24s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
dox: ## Run tests with gotestdox
@gotestdox >/dev/null 2>&1 || go install github.com/bitfield/gotestdox/cmd/gotestdox@latest ;
gotestdox
test: ## Run tests
go test -race
vet: ## Run go vet
go vet ./...
check: ## Run staticcheck analyzer
@staticcheck -version >/dev/null 2>&1 || go install honnef.co/go/tools/cmd/[email protected];
staticcheck ./...
cover: ## Run unit tests and generate test coverage report
go test -race -v ./... -count=1 -cover -covermode=atomic -coverprofile=coverage.out
go tool cover -html coverage.out
tidy: ## Run go mod tidy
go mod tidy