-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
73 lines (54 loc) · 1.29 KB
/
Makefile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
PWD := $(shell pwd)
GOPATH := $(shell go env GOPATH)
export GO111MODULE=on
TEST_FLAGS := "" # "-mod=vendor"
default: help
getdeps:
@echo "Installing golint" && go get -u golang.org/x/lint/golint
verifiers: lint
gen:
@go generate
fmt:
@echo "Running $@"
@${GOPATH}/bin/golint .
lint:
@echo "Running $@"
@${GOPATH}/bin/golint -set_exit_status ./...
metalinter:
@${GOPATH}/bin/gometalinter --install
@${GOPATH}/bin/gometalinter --disable-all \
-E vet \
-E gofmt \
-E misspell \
-E ineffassign \
-E goimports \
-E deadcode --tests --vendor ./...
check: verifiers test
test:
@echo "Running unit tests"
@go test -v $(TEST_FLAGS) -tags kqueue ./...
bench:
@echo "Running bench"
@go test -bench=. -benchmem -benchtime=5s ./...
coverage:
@echo "Running all coverage for surferua"
@(env bash $(PWD)/go-coverage.sh)
pkg-add:
@echo "Adding new package $(PKG)"
@${GOPATH}/bin/govendor add $(PKG)
pkg-update:
@echo "Updating new package $(PKG)"
@${GOPATH}/bin/govendor update $(PKG)
pkg-remove:
@echo "Remove new package $(PKG)"
@${GOPATH}/bin/govendor remove $(PKG)
pkg-list:
@$(GOPATH)/bin/govendor list
clean:
@echo "Cleaning up all the generated files"
@find . -name '*.test' | xargs rm -fv
@rm coverage.txt
@rm -rvf build
@rm -rvf release
help:
@echo "nothing to do!"