-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 714 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (24 loc) · 714 Bytes
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
DIRS=$(shell go list -f {{.Dir}} ./...)
check: fmt vet lint test
cyclo:
@for d in $(DIRS) ; do \
if [ "`gocyclo -over 20 $$d | tee /dev/stderr`" ]; then \
echo "^ cyclomatic complexity exceeds 20, refactor the code!" && echo && exit 1; \
fi \
done
fmt:
@for d in $(DIRS) ; do \
if [ "`gofmt -l -s $$d/*.go | tee /dev/stderr`" ]; then \
echo "^ improperly formatted go files" && echo && exit 1; \
fi \
done
lint:
@if [ "`golint -min_confidence 0.85 ./... | tee /dev/stderr`" ]; then \
echo "^ golint errors!" && echo && exit 1; \
fi
test:
gopherjs test github.com/bep/gr/tests
vet:
@if [ "`go vet ./... | tee /dev/stderr`" ]; then \
echo "^ go vet errors!" && echo && exit 1; \
fi