| 1 |
.PHONY: all clean cover cpu editor internalError later mem nuke todo edit |
| 2 |
|
| 3 |
grep=--include=*.go --include=*.l --include=*.y --include=*.yy |
| 4 |
ngrep='TODOOK\|parser\.go\|scanner\.go\|.*_string\.go' |
| 5 |
|
| 6 |
all: editor |
| 7 |
go vet 2>&1 | grep -v $(ngrep) || true |
| 8 |
golint 2>&1 | grep -v $(ngrep) || true |
| 9 |
make todo |
| 10 |
unused . || true |
| 11 |
misspell *.go |
| 12 |
gosimple || true |
| 13 |
|
| 14 |
clean: |
| 15 |
go clean |
| 16 |
rm -f *~ *.test *.out |
| 17 |
|
| 18 |
cover: |
| 19 |
t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t |
| 20 |
|
| 21 |
cpu: clean |
| 22 |
go test -run @ -bench . -cpuprofile cpu.out |
| 23 |
go tool pprof -lines *.test cpu.out |
| 24 |
|
| 25 |
edit: |
| 26 |
gvim -p Makefile *.go |
| 27 |
|
| 28 |
editor: |
| 29 |
gofmt -l -s -w *.go |
| 30 |
go test |
| 31 |
go build |
| 32 |
|
| 33 |
internalError: |
| 34 |
egrep -ho '"internal error.*"' *.go | sort | cat -n |
| 35 |
|
| 36 |
later: |
| 37 |
@grep -n $(grep) LATER * || true |
| 38 |
@grep -n $(grep) MAYBE * || true |
| 39 |
|
| 40 |
mem: clean |
| 41 |
go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h |
| 42 |
go tool pprof -lines -web -alloc_space *.test mem.out |
| 43 |
|
| 44 |
nuke: clean |
| 45 |
go clean -i |
| 46 |
|
| 47 |
todo: |
| 48 |
@grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * || true |
| 49 |
@grep -nr $(grep) TODO * || true |
| 50 |
@grep -nr $(grep) BUG * || true |
| 51 |
@grep -nr $(grep) [^[:alpha:]]println * || true |