forked from bnb-chain/greenfield-storage-provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.15 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
SHELL := /bin/bash
.PHONY: all check format vet generate install-tools buf-gen build test tidy clean
help:
@echo "Please use \`make <target>\` where <target> is one of"
@echo " vet to do static check"
@echo " build to create bin directory and build"
@echo " generate to generate code"
format:
bash script/format.sh
gofmt -w -l .
proto-format:
buf format -w
proto-format-check:
buf format --diff --exit-code
vet:
go vet ./...
generate:
go generate ./...
install-tools:
go install github.com/golang/mock/mockgen@v1.6.0
go install github.com/bufbuild/buf/cmd/buf@v1.13.1
go install github.com/cosmos/gogoproto/protoc-gen-gocosmos
buf-gen:
buf generate
build:
bash +x ./build.sh
tidy:
go mod tidy
go mod verify
# only run unit test, exclude e2e tests
test:
mockgen -source=core/spdb/spdb.go -destination=core/spdb/spdb_mock.go -package=spdb
mockgen -source=store/bsdb/database.go -destination=store/bsdb/database_mock.go -package=bsdb
go test `go list ./... | grep -v /test/`
# go test -cover ./...
clean:
rm -rf ./service/types/*.pb.go && rm -rf ./service/*/types/*.pb.go
lint:
golangci-lint run --fix