diff --git a/Makefile b/Makefile index 9b07cd5cb..ee2839163 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,32 @@ metalinter: ensure_tools metalinter_test: ensure_tools @gometalinter --install - gometalinter --vendor --deadline=600s --disable-all --enable=deadcode dupl ./... + gometalinter --vendor --deadline=600s --disable-all \ + --enable=deadcode \ + --enable=gas \ + --enable=goimports \ + --enable=gosimple \ + --enable=gotype \ + --enable=ineffassign \ + --enable=misspell \ + --enable=safesql \ + --enable=structcheck \ + --enable=varcheck \ + ./... + + #--enable=aligncheck \ + #--enable=dupl \ + #--enable=errcheck \ + #--enable=goconst \ + #--enable=gocyclo \ + #--enable=golint \ <== comments on anything exported + #--enable=interfacer \ + #--enable=megacheck \ + #--enable=staticcheck \ + #--enable=unconvert \ + #--enable=unparam \ + #--enable=unused \ + #--enable=vet \ + #--enable=vetshadow \ .PHONY: install build build_race dist test test_race test_integrations test100 draw_deps list_deps get_deps get_vendor_deps update_deps revision tools diff --git a/benchmarks/map_test.go b/benchmarks/map_test.go index 2d9789026..c89eba536 100644 --- a/benchmarks/map_test.go +++ b/benchmarks/map_test.go @@ -1,4 +1,4 @@ -package benchmarks +package benchmarks // nolint (goimports) import ( "testing" diff --git a/consensus/byzantine_test.go b/consensus/byzantine_test.go index 163f5490a..705cdc12a 100644 --- a/consensus/byzantine_test.go +++ b/consensus/byzantine_test.go @@ -70,7 +70,7 @@ func TestByzantine(t *testing.T) { conR.SetLogger(logger.With("validator", i)) conR.SetEventBus(eventBus) - var conRI p2p.Reactor + var conRI p2p.Reactor // nolint (gotype) conRI = conR if i == 0 { diff --git a/consensus/state.go b/consensus/state.go index 608d5d2da..c50e431e1 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -371,7 +371,7 @@ func (cs *ConsensusState) updateRoundStep(round int, step cstypes.RoundStepType) // enterNewRound(height, 0) at cs.StartTime. func (cs *ConsensusState) scheduleRound0(rs *cstypes.RoundState) { //cs.Logger.Info("scheduleRound0", "now", time.Now(), "startTime", cs.StartTime) - sleepDuration := rs.StartTime.Sub(time.Now()) + sleepDuration := rs.StartTime.Sub(time.Now()) // nolint (gotype) cs.scheduleTimeout(sleepDuration, rs.Height, 0, cstypes.RoundStepNewHeight) } @@ -702,10 +702,7 @@ func (cs *ConsensusState) needProofBlock(height int) bool { } lastBlockMeta := cs.blockStore.LoadBlockMeta(height - 1) - if !bytes.Equal(cs.state.AppHash, lastBlockMeta.Header.AppHash) { - return true - } - return false + return !bytes.Equal(cs.state.AppHash, lastBlockMeta.Header.AppHash) } func (cs *ConsensusState) proposalHeartbeat(height, round int) { diff --git a/node/id.go b/node/id.go index fa391f946..95c87c8db 100644 --- a/node/id.go +++ b/node/id.go @@ -1,4 +1,4 @@ -package node +package node // nolint (goimports) import ( "time"