Skip to content

Commit

Permalink
Makefile: split make check into multiple targets (pingcap#6253)
Browse files Browse the repository at this point in the history
Makes it convenient when we only need to check one of the targets.
  • Loading branch information
coocood authored and ngaut committed Apr 11, 2018
1 parent d4d1851 commit 1518319
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ parserlib: parser/parser.go
parser/parser.go: parser/parser.y
make parser

check: errcheck
go get github.com/golang/lint/golint
check: fmt errcheck lint vet

@echo "vet"
@ go tool vet -all -shadow $(TOPDIRS) 2>&1 | awk '{print} END{if(NR>0) {exit 1}}'
@echo "golint"
@ golint -set_exit_status $(PACKAGES)
fmt:
@echo "gofmt (simplify)"
@ gofmt -s -l -w $(FILES) 2>&1 | grep -v "vendor|parser/parser.go" | awk '{print} END{if(NR>0) {exit 1}}'

Expand All @@ -88,8 +84,18 @@ goword:

errcheck:
go get github.com/kisielk/errcheck
@echo "errcheck"
@ GOPATH=$(GOPATH) errcheck -blank $(PACKAGES) | grep -v "_test\.go" | awk '{print} END{if(NR>0) {exit 1}}'

lint:
go get github.com/golang/lint/golint
@echo "golint"
@ golint -set_exit_status $(PACKAGES)

vet:
@echo "vet"
@ go tool vet -all -shadow $(TOPDIRS) 2>&1 | awk '{print} END{if(NR>0) {exit 1}}'

clean:
$(GO) clean -i ./...
rm -rf *.out
Expand Down

0 comments on commit 1518319

Please sign in to comment.