-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (34 loc) · 1.08 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
LIST_ALL := $(shell go list ./... | grep -v vendor | grep -v mocks)
all: lint test
.PHONY: lint
lint: ## Lint the files
@golangci-lint version
@golangci-lint run --timeout 3m0s
.PHONY: test
test: ## Run unit tests
@go test -short -count 1 -v ./...
.PHONY: race
race: ## Run data race detector
@go test -race -short -count 1 -v ./...
.PHONY: coverage
coverage: ## Generate coverage report
@go-acc ./...
@go tool cover -func=coverage.txt
.PHONY: depcheck
depcheck: ## Check dependencies for vulnerabilities
@go list -json -deps ./... | nancy sleuth
.PHONY: upgrade
upgrade: ## Upgrade the dependencies
@go get -u -t ./...
@go mod tidy
@go mod vendor
.PHONY: licensecheck
licensecheck: ## Check dependencies for forbidden licenses
@go-licenses check $$(go list -deps -test ./... | grep -v "\.test")
.PHONY: clean
clean: ## Remove outdated file and empty cache
@rm -rf "$(go env GOCACHE)"
@rm -f coverage.*
.PHONY: help
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'