forked from tendermint/go-amino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (55 loc) · 2.04 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
68
69
70
71
72
73
74
GOTOOLS = \
github.com/golangci/golangci-lint/cmd/golangci-lint
GOTOOLS_CHECK = golangci-lint
all: check_tools test
########################################
### Build
build:
# Nothing to build!
install:
# Nothing to install!
########################################
### Tools & dependencies
check_tools:
@# https://stackoverflow.com/a/25668869
@echo "Found tools: $(foreach tool,$(GOTOOLS_CHECK),\
$(if $(shell which $(tool)),$(tool),$(error "No $(tool) in PATH")))"
get_tools:
@echo "--> Installing tools"
go get -v $(GOTOOLS)
update_tools:
@echo "--> Updating tools"
@go get -u -v $(GOTOOLS)
########################################
### Testing
test:
go test $(shell go list ./... | grep -v vendor)
gofuzz_binary:
rm -rf tests/fuzz/binary/corpus/
rm -rf tests/fuzz/binary/crashers/
rm -rf tests/fuzz/binary/suppressions/
go run tests/fuzz/binary/init-corpus/main.go --corpus-parent=tests/fuzz/binary
# TODO: update when https://github.com/dvyukov/go-fuzz/issues/195 is resolved
GO111MODULE=off go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/binary
GO111MODULE=off go-fuzz -bin=./fuzz_binary-fuzz.zip -workdir=tests/fuzz/binary
gofuzz_json:
rm -rf tests/fuzz/json/corpus/
rm -rf tests/fuzz/json/crashers/
rm -rf tests/fuzz/json/suppressions/
# TODO: update when https://github.com/dvyukov/go-fuzz/issues/195 is resolved
GO111MODULE=off go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/json
GO111MODULE=off go-fuzz -bin=./fuzz_json-fuzz.zip -workdir=tests/fuzz/json
########################################
### Formatting, linting, and vetting
fmt:
@go fmt ./...
# look into .golangci.yml for enabling / disabling linters
lint:
@echo "--> Running linter"
@golangci-lint run
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
go mod verify
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: build install check_tools get_tools fmt lint test