mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 18:51:39 +00:00
Update Makefile
This commit is contained in:
101
Makefile
101
Makefile
@ -1,70 +1,99 @@
|
|||||||
.PHONEY: all test install get_vendor_deps ensure_tools codegen wordlist
|
|
||||||
|
|
||||||
GOTOOLS = \
|
GOTOOLS = \
|
||||||
github.com/Masterminds/glide \
|
github.com/Masterminds/glide \
|
||||||
github.com/jteeuwen/go-bindata/go-bindata \
|
github.com/jteeuwen/go-bindata/go-bindata \
|
||||||
github.com/alecthomas/gometalinter
|
gopkg.in/alecthomas/gometalinter.v2 \
|
||||||
|
GOTOOLS_CHECK = glide go-bindata gometalinter.v2
|
||||||
|
|
||||||
REPO:=github.com/tendermint/go-crypto
|
all: check get_vendor_deps build test install metalinter
|
||||||
|
|
||||||
all: get_vendor_deps metalinter_test test
|
check: check_tools
|
||||||
|
|
||||||
test:
|
|
||||||
go test -p 1 `glide novendor`
|
|
||||||
|
|
||||||
get_vendor_deps: ensure_tools
|
########################################
|
||||||
|
### Build
|
||||||
|
|
||||||
|
wordlist:
|
||||||
|
# Generating wordlist.go...
|
||||||
|
go-bindata -ignore ".*\.go" -o keys/wordlist/wordlist.go -pkg "wordlist" keys/wordlist/...
|
||||||
|
|
||||||
|
build: wordlist
|
||||||
|
# Nothing else 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 -u -v $(GOTOOLS)
|
||||||
|
@gometalinter.v2 --install
|
||||||
|
|
||||||
|
update_tools:
|
||||||
|
@echo "--> Updating tools"
|
||||||
|
@go get -u $(GOTOOLS)
|
||||||
|
|
||||||
|
get_vendor_deps:
|
||||||
@rm -rf vendor/
|
@rm -rf vendor/
|
||||||
@echo "--> Running glide install"
|
@echo "--> Running glide install"
|
||||||
@glide install
|
@glide install
|
||||||
|
|
||||||
ensure_tools:
|
|
||||||
go get $(GOTOOLS)
|
|
||||||
|
|
||||||
wordlist:
|
########################################
|
||||||
go-bindata -ignore ".*\.go" -o keys/wordlist/wordlist.go -pkg "wordlist" keys/wordlist/...
|
### Testing
|
||||||
|
|
||||||
prepgen: install
|
test:
|
||||||
go install ./vendor/github.com/btcsuite/btcutil/base58
|
go test -p 1 `glide novendor`
|
||||||
go install ./vendor/github.com/stretchr/testify/assert
|
|
||||||
go install ./vendor/github.com/stretchr/testify/require
|
|
||||||
go install ./vendor/golang.org/x/crypto/bcrypt
|
|
||||||
|
|
||||||
codegen:
|
|
||||||
@echo "--> regenerating all interface wrappers"
|
|
||||||
@gen
|
|
||||||
@echo "Done!"
|
|
||||||
|
|
||||||
metalinter: ensure_tools
|
########################################
|
||||||
@gometalinter --install
|
### Formatting, linting, and vetting
|
||||||
gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
|
|
||||||
|
|
||||||
metalinter_test: ensure_tools
|
fmt:
|
||||||
@gometalinter --install
|
@go fmt ./...
|
||||||
gometalinter --vendor --deadline=600s --disable-all \
|
|
||||||
|
metalinter:
|
||||||
|
@echo "==> Running linter"
|
||||||
|
gometalinter.v2 --vendor --deadline=600s --disable-all \
|
||||||
|
--enable=maligned \
|
||||||
--enable=deadcode \
|
--enable=deadcode \
|
||||||
--enable=gas \
|
|
||||||
--enable=goconst \
|
--enable=goconst \
|
||||||
--enable=gocyclo \
|
--enable=goimports \
|
||||||
--enable=gosimple \
|
--enable=gosimple \
|
||||||
--enable=ineffassign \
|
--enable=ineffassign \
|
||||||
--enable=interfacer \
|
|
||||||
--enable=maligned \
|
|
||||||
--enable=megacheck \
|
--enable=megacheck \
|
||||||
--enable=misspell \
|
--enable=misspell \
|
||||||
--enable=safesql \
|
|
||||||
--enable=staticcheck \
|
--enable=staticcheck \
|
||||||
|
--enable=safesql \
|
||||||
--enable=structcheck \
|
--enable=structcheck \
|
||||||
--enable=unconvert \
|
--enable=unconvert \
|
||||||
--enable=unused \
|
--enable=unused \
|
||||||
--enable=vet \
|
|
||||||
--enable=varcheck \
|
--enable=varcheck \
|
||||||
--enable=vetshadow \
|
--enable=vetshadow \
|
||||||
./...
|
./...
|
||||||
|
#--enable=gas \
|
||||||
|
|
||||||
#--enable=dupl \
|
#--enable=dupl \
|
||||||
#--enable=errcheck \
|
#--enable=errcheck \
|
||||||
#--enable=goimports \
|
#--enable=gocyclo \
|
||||||
#--enable=golint \ <== comments on anything exported
|
#--enable=golint \ <== comments on anything exported
|
||||||
#--enable=gotype \
|
#--enable=gotype \
|
||||||
|
#--enable=interfacer \
|
||||||
#--enable=unparam \
|
#--enable=unparam \
|
||||||
|
#--enable=vet \
|
||||||
|
|
||||||
|
metalinter_all:
|
||||||
|
protoc $(INCLUDE) --lint_out=. types/*.proto
|
||||||
|
gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./...
|
||||||
|
|
||||||
|
|
||||||
|
# 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
|
||||||
|
.PHONEY: check wordlist build install check_tools get_tools update_tools get_vendor_deps test fmt metalinter metalinter_all
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user