| 🛟 Updated. 28d5985 k33g 16h ago | 1 | # turbo-core is a library: there is nothing to build into a binary here, so the |
| 2 | # targets are the ones that check it. |
| 3 | |
| 4 | # The version this checkout would publish, for the release script and for |
| 5 | # anybody wondering what is on HEAD. A library has no binary to stamp, so this |
| 6 | # is reported rather than compiled in. |
| 7 | VERSION := $(shell git describe --tags --dirty 2>/dev/null || echo untagged) |
| 8 | COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null) |
| 9 | |
| 10 | .DEFAULT_GOAL := help |
| 11 | |
| 12 | ## help: list the available targets |
| 13 | help: |
| 14 | @grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //' |
| 15 | |
| 16 | ## test: run the whole test suite — the single documented command |
| 17 | test: |
| 18 | go test ./... |
| 19 | |
| 20 | ## test-verbose: run the whole test suite, naming every test |
| 21 | test-verbose: |
| 22 | go test -v ./... |
| 23 | |
| 24 | ## race: run the whole suite with the race detector |
| 25 | race: |
| 26 | go test -race ./... |
| 27 | |
| 28 | ## cover: run the tests and report statement coverage per package |
| 29 | cover: |
| 30 | go test -cover ./... |
| 31 | |
| 32 | ## version: print the version this checkout would publish |
| 33 | version: |
| 34 | @echo "$(VERSION) ($(COMMIT))" |
| 35 | |
| 36 | ## fmt: format every Go file in place |
| 37 | fmt: |
| 38 | go fmt ./... |
| 39 | |
| 40 | ## vet: run the standard Go static checks |
| 41 | vet: |
| 42 | go vet ./... |
| 43 | |
| 44 | ## check: format, vet and test — what to run before committing |
| 45 | check: fmt vet test |
| 46 | |
| 47 | .PHONY: help test test-verbose race cover version fmt vet check |