forked from visionmedia/go-debug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (20 loc) · 966 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
26
27
28
29
.PHONY: help test report bench lint tidy
LINE_LENGTH=$(shell yq r .golangci.yml linters-settings.lll.line-length)
help: ## Generates this help message
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
test: ## unit tests
@go test $(shell go list ./... | grep -v /example/ | grep -v /vendor/ | grep -v /integration) -failfast -covermode=atomic -coverprofile=coverage.txt
test-thread: ## unit tests
go test $(shell go list ./... | grep -v /example/ | grep -v /vendor/ | grep /integration) -failfast -covermode=atomic -coverprofile=coverage.txt
report: ## coverage report
@go tool cover -html=coverage.txt
bench: ## benchmark tests
@go test -bench=. -benchmem
lint: ## Run the linter
@golines -m $(LINE_LENGTH) . -w --ignored-dirs=vendor
@golangci-lint run --fix
tidy: ## clean up vendoring
@go mod vendor
@go mod tidy
@go mod verify
@git add go.mod go.sum