-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (38 loc) · 944 Bytes
/
Copy pathMakefile
File metadata and controls
45 lines (38 loc) · 944 Bytes
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
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
## audit: format, vet and test all code
.PHONY: audit
audit:
@echo 'Formatting code...'
go fmt ./...
@echo 'Vetting code...'
go vet ./...
@echo 'Running tests...'
go test -short -race -vet=off ./...
## test: run tests
.PHONY: test
test:
go test -shuffle=on -short -vet=off -race -timeout 15s -covermode=atomic -coverprofile=/tmp/profile.out ./...
## cover: run test coverage
.PHONY: cover
cover:
go test -short -covermode=count -coverprofile=/tmp/profile.out ./...
## analyze: analyze test coverage in your browser
.PHONY: analyze
analyze: cover
go tool cover -html=/tmp/profile.out
## lint: run linters
.PHONY: lint
lint:
golangci-lint run --fix ./...
## fix: run go fix
.PHONY: fix
fix:
go fix ./...
## verify: fix, lint and test
.PHONY: verify
verify: fix lint test
go mod verify