-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
25 lines (18 loc) · 819 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: install-tools lint test test-verbose format help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install-tools: ## Install linting tools
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install mvdan.cc/gofumpt@latest
go install github.com/segmentio/golines@latest
lint: ## Run golangci linter
golangci-lint run -c ./golangci.yml ./...
format: ## Format code
gofumpt -l -w -extra .
golines . -w
test: ## Run tests
go test -race -count=10 -shuffle on -cover ./...
test-verbose: ## Run tests with verbose output
go test -race -count=10 -shuffle on -v -cover ./...
test-trimpath: ## Run tests with -trimpath
GOFLAGS=-trimpath go test -race -count=10 -shuffle on -v -cover ./examples