-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
20 lines (18 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
PACKAGES=`go list ./... | grep -v vendor`
FILES=$(shell find . -name "*.go" | grep -v vendor | grep -v .pb.go)
# TODO: Remove 'should have comment'
lint:
@echo -n ">> fmt" && \
gofmt -s -l -w ${FILES} | awk '{print ""; print} END {if (NR > 0) {exit 1} else print "... ok"}' && \
echo -n ">> lint" && \
golint ${PACKAGES} | grep -v 'should have comment' | awk '{print} END {if (NR > 0) {exit 1} else print "... ok"}' && \
echo -n ">> go vet" && \
go vet ${PACKAGES} | awk '{print ""; print} END {if (NR > 0) {exit 1} else print "... ok"}' && \
echo -n ">> long line" && \
lll -g -l 100 ${FILES} | awk '{print ""; print} END {if (NR > 0) {exit 1} else print "... ok"}' && \
echo -n ">> errcheck" && \
errcheck ${PACKAGES} | awk '{print ""; print} END {if (NR > 0) {exit 1} else print "... ok"}' && \
echo -n ">> go simple" && \
gosimple ${PACKAGES} | awk '{print ""; print} END {if (NR > 0) {exit 1} else print "... ok"}' && \
echo -n ">> unused" && \
unused ${PACKAGES} | awk '{print ""; print} END {if (NR > 0) {exit 1} else print "... ok"}'