forked from vulcand/oxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.04 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
.PHONY: all
export GO111MODULE=on
PKGS := $(shell go list ./... | grep -v '/vendor/')
GOFILES := $(shell go list -f '{{range $$index, $$element := .GoFiles}}{{$$.Dir}}/{{$$element}}{{"\n"}}{{end}}' ./... | grep -v '/vendor/')
TXT_FILES := $(shell find * -type f -not -path 'vendor/**')
default: clean misspell vet check-fmt test
test: clean
go test -race -cover $(PKGS)
test-verbose: clean
go test -v -race -cover $(PKGS)
clean:
find . -name flymake_* -delete
rm -f cover.out
lint:
echo "golint:"
golint -set_exit_status $(PKGS)
vet:
go vet $(PKGS)
checks: vet lint check-fmt
staticcheck $(PKGS)
gosimple $(PKGS)
check-fmt: SHELL := /bin/bash
check-fmt:
diff -u <(echo -n) <(gofmt -d $(GOFILES))
misspell:
misspell -source=text -error $(TXT_FILES)
test-package: clean
go test -v ./$(p)
test-grep-package: clean
go test -v ./$(p) -check.f=$(e)
cover-package: clean
go test -v ./$(p) -coverprofile=/tmp/coverage.out
go tool cover -html=/tmp/coverage.out
sloccount:
find . -path ./vendor -prune -o -name "*.go" -print0 | xargs -0 wc -l