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
45
46
47
|
# turbo-core is a library: there is nothing to build into a binary here, so the
# targets are the ones that check it.
# The version this checkout would publish, for the release script and for
# anybody wondering what is on HEAD. A library has no binary to stamp, so this
# is reported rather than compiled in.
VERSION := $(shell git describe --tags --dirty 2>/dev/null || echo untagged)
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
.DEFAULT_GOAL := help
## help: list the available targets
help:
@grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## //'
## test: run the whole test suite — the single documented command
test:
go test ./...
## test-verbose: run the whole test suite, naming every test
test-verbose:
go test -v ./...
## race: run the whole suite with the race detector
race:
go test -race ./...
## cover: run the tests and report statement coverage per package
cover:
go test -cover ./...
## version: print the version this checkout would publish
version:
@echo "$(VERSION) ($(COMMIT))"
## fmt: format every Go file in place
fmt:
go fmt ./...
## vet: run the standard Go static checks
vet:
go vet ./...
## check: format, vet and test — what to run before committing
check: fmt vet test
.PHONY: help test test-verbose race cover version fmt vet check
|