-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
38 lines (31 loc) · 882 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
37
38
GOLANG_CI_LINT_VER:=v1.61.0
COVER_PACKAGES=${shell go list ./... | grep -Ev 'test|cmd' | tr '\n' ','}
all: lint test
.PHONY: all
lint: bin/golangci-lint-$(GOLANG_CI_LINT_VER)
./bin/golangci-lint-$(GOLANG_CI_LINT_VER) run
.PHONY: lint
test:
go test \
-coverpkg=${COVER_PACKAGES} \
-covermode=count \
-coverprofile=coverage.out \
./...
go tool cover -func=coverage.out
.PHONY: test
test.fuzz:
# make test.fuzz NAME=FuzzIPv4
# make test.fuzz NAME=FuzzRangeNumber
go test -fuzz $(NAME) "github.com/hedhyw/rex/pkg/dialect/base"
.PHONY: test.fuzz
tidy:
go mod tidy
.PHONY: vendor
bin/golangci-lint-$(GOLANG_CI_LINT_VER):
curl \
-sSfL \
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s $(GOLANG_CI_LINT_VER)
mv bin/golangci-lint bin/golangci-lint-$(GOLANG_CI_LINT_VER)
build:
go build -o ./bin/rex ./cmd/generator/main.go