gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Makefile (1327B)


      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 	maligned || true
     14 	unconvert -apply
     15 
     16 clean:
     17 	go clean
     18 	rm -f *~ *.test *.out
     19 
     20 cover:
     21 	t=$(shell mktemp) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t
     22 
     23 cpu: clean
     24 	go test -run @ -bench . -cpuprofile cpu.out
     25 	go tool pprof -lines *.test cpu.out
     26 
     27 edit:
     28 	gvim -p Makefile *.go
     29 
     30 editor:
     31 	gofmt -l -s -w *.go
     32 	go test -i
     33 	go test 2>&1 | tee log
     34 	go install
     35 
     36 internalError:
     37 	egrep -ho '"internal error.*"' *.go | sort | cat -n
     38 
     39 later:
     40 	@grep -n $(grep) LATER * || true
     41 	@grep -n $(grep) MAYBE * || true
     42 
     43 mem: clean
     44 	go test -run @ -bench . -memprofile mem.out -memprofilerate 1 -timeout 24h
     45 	go tool pprof -lines -web -alloc_space *.test mem.out
     46 
     47 nuke: clean
     48 	go clean -i
     49 
     50 todo:
     51 	@grep -nr $(grep) ^[[:space:]]*_[[:space:]]*=[[:space:]][[:alpha:]][[:alnum:]]* * | grep -v $(ngrep) || true
     52 	@grep -nr $(grep) TODO * | grep -v $(ngrep) || true
     53 	@grep -nr $(grep) BUG * | grep -v $(ngrep) || true
     54 	@grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true