-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
46 lines (40 loc) · 904 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
46
.DEFAULT_GOAL := test
# Clean up
clean:
@rm -fR ./cover.*
.PHONY: clean
# Run tests and generates html coverage file
cover: test
@go tool cover -html=./coverage.text -o ./coverage.html
.PHONY: cover
# Download dependencies
depend:
@go get -u gopkg.in/alecthomas/gometalinter.v2
@gometalinter.v2 --install
.PHONY: depend
# Format all go files
fmt:
gofmt -s -w -l $(shell go list -f {{.Dir}} ./...)
.PHONY: fmt
# Run linters
lint:
@gometalinter.v2 \
--disable-all \
--exclude=vendor \
--deadline=180s \
--enable=gofmt \
--linter='errch:errcheck {path}:PATH:LINE:MESSAGE' \
--enable=errch \
--enable=vet \
--enable=gocyclo \
--cyclo-over=15 \
--enable=golint \
--min-confidence=0.85 \
--enable=ineffassign \
--enable=misspell \
./..
.PHONY: lint
# Run tests
test:
@go test -v -race -coverprofile=./coverage.text -covermode=atomic $(shell go list ./...)
.PHONY: test