-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (50 loc) · 1.05 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
-include .env
PACKAGE := "github.com/siyul-park/jsonata-go"
GO_PACKAGE := $(shell go list ${PACKAGE}/...)
.PHONY: init
init:
@go install -v ${GO_PACKAGE}
.PHONY: init-staticcheck
init-staticcheck:
@go install honnef.co/go/tools/cmd/staticcheck@latest
.PHONY: generate
generate:
@go generate ${GO_PACKAGE}
.PHONY: build
build:
@go clean -cache
@mkdir -p dist
@go build -o dist ./...
.PHONY: clean
clean:
@go clean -cache
@rm -rf dist
.PHONY: tidy
tidy:
@go mod tidy
.PHONY: check
check: lint test
.PHONY: test
test:
@go test $(test-options) ${GO_PACKAGE}
.PHONY: race
race:
@go test -race $(test-options) ${GO_PACKAGE}
.PHONY: coverage
coverage:
@go test -coverprofile coverage.out -covermode count ${GO_PACKAGE}
@go tool cover -func=coverage.out | grep total
.PHONY: benchmark
benchmark:
@go test -run="-" -bench=".*" -benchmem ${GO_PACKAGE}
.PHONY: lint
lint: fmt vet staticcheck
.PHONY: vet
vet:
@go vet ${GO_PACKAGE}
.PHONY: fmt
fmt:
@go fmt ${GO_PACKAGE}
.PHONY: staticcheck
staticcheck: init-staticcheck
@staticcheck ${GO_PACKAGE}