-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
46 lines (36 loc) · 1.15 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
BIN=go
build:
${BIN} build -v ./...
test:
go test -v ./...
watch-test:
reflex -t 50ms -s -- sh -c 'gotest -v ./...'
bench:
go test -benchmem -count 3 -bench ./...
watch-bench:
reflex -t 50ms -s -- sh -c 'go test -benchmem -count 3 -bench ./...'
coverage:
${BIN} test -v -coverprofile=cover.out -covermode=atomic .
${BIN} tool cover -html=cover.out -o cover.html
# tools
tools:
${BIN} install github.com/cespare/reflex@latest
${BIN} install github.com/rakyll/gotest@latest
${BIN} install github.com/psampaz/go-mod-outdated@latest
${BIN} install github.com/jondot/goweight@latest
${BIN} install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
${BIN} get -t -u golang.org/x/tools/cmd/cover
${BIN} install github.com/sonatype-nexus-community/nancy@latest
go mod tidy
lint:
golangci-lint run --print-resources-usage --fast --timeout 20m0s --max-same-issues 50 ./...
lint-fix:
golangci-lint run --print-resources-usage --fast --timeout 20m0s --max-same-issues 50 --fix ./...
audit:
${BIN} mod tidy
${BIN} list -json -m all | nancy sleuth
outdated:
${BIN} mod tidy
${BIN} list -u -m -json all | go-mod-outdated -update -direct
weight:
goweight