|
1 | | -module = gitlab.com/thorchain/tss/go-tss |
| 1 | +module = github.com/zeta-chain/go-tss |
2 | 2 |
|
3 | | -.PHONY: clear tools install test test-watch lint-pre lint lint-verbose protob build docker-gitlab-login docker-gitlab-push docker-gitlab-build |
| 3 | +help: ## List of commands |
| 4 | + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
4 | 5 |
|
5 | | -all: lint build |
| 6 | +deps: ## Install required dev tooling: |
| 7 | + go install github.com/golangci/golangci-lint/cmd/ [email protected] |
| 8 | + go install github.com/segmentio/ [email protected] |
6 | 9 |
|
7 | | -clear: |
8 | | - clear |
9 | | - |
10 | | -tools: |
| 10 | +tools: ## Installs tss tools |
11 | 11 | go install ./cmd/tss-recovery |
12 | 12 | go install ./cmd/tss-benchgen |
13 | 13 | go install ./cmd/tss-benchsign |
14 | 14 |
|
15 | | -install: go.sum |
| 15 | +install: go.sum ## Compiles & install go-tss binary |
16 | 16 | go install ./cmd/tss |
17 | 17 |
|
18 | | -go.sum: go.mod |
| 18 | +go.sum: go.mod ## Go sum |
19 | 19 | @echo "--> Ensure dependencies have not been modified" |
20 | 20 | go mod verify |
21 | 21 |
|
22 | | -test: |
23 | | - @go test --race -timeout 30m ./... |
| 22 | +test: ## Runs tests |
| 23 | + @go test -race -timeout 30m ./... |
24 | 24 |
|
25 | | -test-watch: clear |
26 | | - @gow -c test -tags testnet -mod=readonly ./... |
| 25 | +fmt: ## Formats the code |
| 26 | + @echo "Fixing long lines" |
| 27 | + @golines -w --max-len=120 --ignore-generated --ignored-dirs=".git" --base-formatter="gofmt" . |
27 | 28 |
|
28 | | -unittest: |
29 | | - @go test --race -v -coverprofile=coverage.out -timeout 30m ./... |
30 | | - @go tool cover -func=coverage.out |
| 29 | + @echo "Formatting code" |
| 30 | + @golangci-lint run --enable-only 'gci' --enable-only 'gofmt' --enable-only 'whitespace' --fix |
31 | 31 |
|
32 | | -lint-pre: |
33 | | - @gofumpt -l cmd common keygen keysign messages p2p storage tss # for display |
34 | | - @test -z "$(shell gofumpt -l cmd common keygen keysign messages p2p storage tss)" # cause error |
35 | | - @go mod verify |
| 32 | +lint-pre: ## Runs pre-lint check |
| 33 | + @test -z $(gofmt -l .) |
| 34 | + go mod verify |
36 | 35 |
|
37 | | -lint: lint-pre |
| 36 | +lint: lint-pre ## Runs linter |
38 | 37 | @golangci-lint run |
39 | 38 |
|
40 | | -lint-verbose: lint-pre |
41 | | - @golangci-lint run -v |
42 | | - |
43 | | -protob: |
| 39 | +codegen: ## Generates proto |
44 | 40 | protoc --go_out=module=$(module):. ./messages/*.proto |
45 | 41 |
|
46 | | -build: protob |
47 | | - go build ./... |
48 | | - |
49 | | -docker-build: |
50 | | - docker build -t registry.gitlab.com/thorchain/tss/go-tss . |
| 42 | +.PHONY: deps tools install test fmt lint-pre lint codegen |
0 commit comments