Browse Source

makefile: lint flags

pull/2159/head
Ethan Buchman 6 years ago
parent
commit
b189ab676f
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      Makefile

+ 4
- 5
Makefile View File

@ -10,6 +10,8 @@ INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protob
BUILD_TAGS?='tendermint' BUILD_TAGS?='tendermint'
BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`" BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`"
LINT_FLAGS = --exclude '.*\.pb\.go' --vendor --deadline=600s
all: check build test install all: check build test install
check: check_tools get_vendor_deps check: check_tools get_vendor_deps
@ -39,9 +41,6 @@ protoc_all: protoc_libs protoc_abci protoc_grpc
## Note the $< here is substituted for the %.proto ## Note the $< here is substituted for the %.proto
## Note the $@ here is substituted for the %.pb.go ## Note the $@ here is substituted for the %.pb.go
protoc $(INCLUDE) $< --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,plugins=grpc:. protoc $(INCLUDE) $< --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,plugins=grpc:.
## Note we don't use inplace since it's not natively available on mac
@echo "--> adding nolint declarations to protobuf generated files"
@awk '/^\s*package \w+/ { print "//nolint" }1' $@ > $@.tmp && mv $@.tmp $@
######################################## ########################################
### Build ABCI ### Build ABCI
@ -220,7 +219,7 @@ fmt:
metalinter: metalinter:
@echo "--> Running linter" @echo "--> Running linter"
@gometalinter.v2 --vendor --deadline=600s --disable-all \
@gometalinter.v2 $(LINT_FLAGS) --disable-all \
--enable=deadcode \ --enable=deadcode \
--enable=gosimple \ --enable=gosimple \
--enable=misspell \ --enable=misspell \
@ -249,7 +248,7 @@ metalinter:
metalinter_all: metalinter_all:
@echo "--> Running linter (all)" @echo "--> Running linter (all)"
gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./...
gometalinter.v2 $(LINT_FLAGS) --enable-all --disable=lll ./...
DESTINATION = ./index.html.md DESTINATION = ./index.html.md


Loading…
Cancel
Save