-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
45 lines (38 loc) · 850 Bytes
/
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
.DEFAULT_GOAL := test
# Clean up
clean:
rm -fR ./cover.*
.PHONY: clean
# Run tests and generates html coverage file
cover: test
go tool cover -html=./cover.out -o ./cover.html
.PHONY: cover
# Download dependencies
depend:
go get -u gopkg.in/alecthomas/gometalinter.v2
gometalinter.v2 --install
go get -u github.com/golang/dep/...
.PHONY: depend
# Up the docker container for testing
docker:
docker-compose up -d
.PHONY: docker
# Format all go files
fmt:
gofmt -s -w -l $(shell go list -f {{.Dir}} ./... | grep -v /vendor/)
.PHONY: fmt
# Run linters
lint:
gometalinter.v2 \
--vendor \
--disable-all \
--enable=golint \
--enable=gofmt \
--enable=misspell \
--enable=vet ./... \
--deadline=60s
.PHONY: lint
# Run tests
test:
go test -v -race -coverprofile=./cover.out $(shell go list ./... | grep -v /vendor/)
.PHONY: test