-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (43 loc) · 1.42 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
golangci_lint_cmd=golangci-lint
golangci_version=v1.61.1
gofumpt_cmd=gofumpt
gofumpt_version=v0.7.0
default: help
.PHONY: help
## help: Prints this help message
help: Makefile
@echo
@echo "Available make commands:"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
.PHONY: lint
## lint: Lint the repository
lint:
@echo "--> Running linter"
@if ! $(golangci_lint_cmd) --version 2>/dev/null | grep -q $(golangci_version); then \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version); \
fi
@$(golangci_lint_cmd) run ./... --timeout 15m
.PHONY: lint-fix
## lint-fix: Lint the repository and fix warnings (if applicable)
lint-fix:
@echo "--> Running linter and fixing issues"
@if ! $(golangci_lint_cmd) --version 2>/dev/null | grep -q $(golangci_version); then \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version); \
fi
@$(golangci_lint_cmd) run ./... --fix --timeout 15m
.PHONY: gofumpt
## gofumpt: Format the code with gofumpt
gofumpt:
@echo "--> Running gofumpt"
@if ! $(gofumpt_cmd) -version 2>/dev/null | grep -q $(gofumpt_version); then \
go install mvdan.cc/gofumpt@$(gofumpt_version); \
fi
@gofumpt -l -w .
### Interchain Tests ###
.PHONY: ictest-cosmos-chain
## ictest-cosmos-chain: Run the Cosmos chain interchaintest
ictest-cosmos-chain:
@echo "--> Running Cosmos chain interchain test"
@go test -v -run TestChainStart