-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (54 loc) · 1.5 KB
/
Copy pathMakefile
File metadata and controls
72 lines (54 loc) · 1.5 KB
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
68
69
70
71
72
GOTEST_PKGS=$(shell go list ./... | grep -v examples)
BENCHTIME ?= 2s
BENCHTESTS ?= .
BENCHFULL?=0
ifeq (${BENCHFULL},1)
BENCHFULL_ARG=-bench-full -timeout 60m
else
BENCHFULL_ARG=
endif
TEST_VERBOSE?=0
ifeq (${TEST_VERBOSE},1)
TEST_VERBOSE_ARG=-v
else
TEST_VERBOSE_ARG=
endif
TEST_RESULTS?="/tmp/test-results"
generate:
@echo "Regenerating Parser"
@go generate ./
test:
@go test $(TEST_VERBOSE_ARG) $(GOTEST_PKGS)
bench:
@go test $(TEST_VERBOSE_ARG) -run DONTRUNTESTS -bench $(BENCHTESTS) $(BENCHFULL_ARG) -benchtime=$(BENCHTIME) $(GOTEST_PKGS)
coverage:
@go test -coverprofile /tmp/coverage.out $(GOTEST_PKGS)
@go tool cover -html /tmp/coverage.out
fmt:
@gofmt -w -s
examples: simple expr-parse expr-eval filter
simple:
@go build ./examples/simple
expr-parse:
@go build ./examples/expr-parse
expr-eval:
@go build ./examples/expr-eval
filter:
@go build ./examples/filter
deps:
@go install github.com/hashicorp/copywrite@b3e6599f43beff698f471c6f46888045453fa030 # v0.25.3
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@c0d3ddc9cf3faa61a4e378e879ece580256d76e5 # v2.12.2
@go get github.com/mna/pigeon@master
@go get golang.org/x/tools/cmd/goimports
@go get golang.org/x/tools/cmd/cover
@go mod tidy
copywriteheaders:
@echo "==> Running copywrite headers plan..."
@copywrite headers --plan
@echo "==> Done"
.PHONY: lint
lint:
@echo "==> Running linters..."
@golangci-lint run
@echo "==> Done"
.PHONY: generate test coverage fmt lint deps bench examples expr-parse expr-eval filter