-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (29 loc) · 736 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
# make sure targets do not conflict with file and folder names
.PHONY: test
# run quality assessment checks
check:
@echo "Running gofmt ..."
@! gofmt -s -d -l . 2>&1 | grep -vE '^\.git/'
@echo "Ok!"
@echo "Running go vet ..."
@go vet ./...
@echo "Ok!"
@echo "Running goimports ..."
@! goimports -l . | grep -vF 'No Exceptions'
@echo "Ok!"
# format
format:
go fmt ./...
goimports -w .
# get all dependencies
provision:
@echo "Getting dependencies ..."
@go install golang.org/x/tools/cmd/goimports@latest
@go install github.com/gregoryv/uncover/cmd/uncover@latest
@go mod download
@echo "Done!"
# run tests
test:
mkdir -p ./out
go test ./... -cover -v -coverprofile ./out/coverage.txt
uncover ./out/coverage.txt