| 1 |
help: |
| 2 |
@echo "Please use \`make <target>\` where <target> is one of:" |
| 3 |
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \ |
| 4 |
awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}' |
| 5 |
|
| 6 |
init: |
| 7 |
rm -rf bin |
| 8 |
cd tools && go generate -x -tags=tools |
| 9 |
|
| 10 |
TEST_FLAGS ?= -timeout=20s |
| 11 |
|
| 12 |
test: |
| 13 |
go test $(TEST_FLAGS) ./... |
| 14 |
|
| 15 |
test-race: |
| 16 |
go test $(TEST_FLAGS) -race ./... |
| 17 |
|
| 18 |
test-cover: |
| 19 |
go test $(TEST_FLAGS) -coverprofile=cover.out -covermode=count ./... |
| 20 |
|
| 21 |
test-crosscover: |
| 22 |
go test $(TEST_FLAGS) -coverprofile=crosscover.out -covermode=count -coverpkg=./... ./... |
| 23 |
|
| 24 |
check: |
| 25 |
go run .github/check-license.go |
| 26 |
|
| 27 |
FILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*") |
| 28 |
|
| 29 |
format: |
| 30 |
bin/gofumpt -l -w . |
| 31 |
bin/goimports -local github.com/percona/go-mysql -l -w $(FILES) |
| 32 |
|
| 33 |
.PHONY: test |