forked from ChainSafe/chainbridge-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (28 loc) · 1019 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
PROJECTNAME=$(shell basename "$(PWD)")
GOLANGCI := $(GOPATH)/bin/golangci-lint
.PHONY: help lint test
all: help
help: Makefile
@echo
@echo " Choose a make command to run in "$(PROJECTNAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
$(GOLANGCI):
if [ ! -f ./bin/golangci-lint ]; then \
wget -O - -q https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s latest; \
fi;
lint: $(GOLANGCI)
./bin/golangci-lint run ./... --timeout 5m0s
## license: Adds license header to missing files.
license:
@echo " > \033[32mAdding license headers...\033[0m "
GO111MODULE=off go get -u github.com/google/addlicense
addlicense -c "ChainSafe Systems" -f ./scripts/header.txt -y 2021 .
## license-check: Checks for missing license headers
license-check:
@echo " > \033[Checking for license headers...\033[0m "
GO111MODULE=off go get -u github.com/google/addlicense
addlicense -check -c "ChainSafe Systems" -f ./scripts/header.txt -y 2021 .
test:
go test ./...