Replace vet with golangci lint govet (#4277)
Drop go vet in favor of golangci-lint govet check. Fix golangci-lint warnings. Upgrade golangci-lint.
This commit is contained in:
parent
5060187d3d
commit
06f7b2198a
@ -6,6 +6,7 @@ linters:
|
||||
- ineffassign
|
||||
- unconvert
|
||||
- misspell
|
||||
- govet
|
||||
linters-settings:
|
||||
gocyclo:
|
||||
min-complexity: 11
|
||||
@ -13,5 +14,8 @@ linters-settings:
|
||||
ignore: fmt:.*,io/ioutil:^Read.*,github.com/spf13/cobra:MarkFlagRequired,github.com/spf13/viper:BindPFlag
|
||||
golint:
|
||||
min-confidence: 1.1
|
||||
issues:
|
||||
exclude:
|
||||
- composite
|
||||
run:
|
||||
tests: false
|
||||
|
||||
1
Makefile
1
Makefile
@ -209,7 +209,6 @@ test_cover:
|
||||
lint: tools ci-lint
|
||||
ci-lint:
|
||||
golangci-lint run
|
||||
go vet -composites=false -tests=false ./...
|
||||
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
|
||||
go mod verify
|
||||
|
||||
|
||||
@ -91,11 +91,6 @@ func NodeSyncingRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
|
||||
}
|
||||
|
||||
syncing := status.SyncInfo.CatchingUp
|
||||
if err != nil {
|
||||
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := w.Write([]byte(strconv.FormatBool(syncing))); err != nil {
|
||||
log.Printf("could not write response: %v", err)
|
||||
}
|
||||
|
||||
@ -129,7 +129,6 @@ check-all: check-unit check-race check-cover check-build
|
||||
lint: ci-lint
|
||||
ci-lint:
|
||||
golangci-lint run
|
||||
go vet -composites=false -tests=false ./...
|
||||
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
|
||||
go mod verify
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ import (
|
||||
|
||||
"github.com/spf13/viper"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/tendermint/go-amino"
|
||||
amino "github.com/tendermint/go-amino"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
clientkeys "github.com/cosmos/cosmos-sdk/client/keys"
|
||||
|
||||
@ -17,7 +17,7 @@ endif
|
||||
|
||||
GOPATH ?= $(shell $(GO) env GOPATH)
|
||||
GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com
|
||||
GOLANGCI_LINT_VERSION := v1.15.0
|
||||
GOLANGCI_LINT_VERSION := v1.16.0
|
||||
GOLANGCI_LINT_HASHSUM := ac897cadc180bf0c1a4bf27776c410debad27205b22856b861d41d39d06509cf
|
||||
|
||||
###
|
||||
|
||||
@ -4,13 +4,15 @@ package crypto
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
bip39 "github.com/cosmos/go-bip39"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/hd"
|
||||
"github.com/cosmos/cosmos-sdk/tests"
|
||||
"github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/go-bip39"
|
||||
|
||||
secp256k1 "github.com/tendermint/btcd/btcec"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
|
||||
@ -4,9 +4,10 @@ import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/crypto/multisig"
|
||||
"github.com/tendermint/tendermint/crypto/secp256k1"
|
||||
|
||||
@ -312,8 +312,8 @@ func (sup SoftwareUpgradeProposal) String() string {
|
||||
}
|
||||
|
||||
var validProposalTypes = map[string]struct{}{
|
||||
ProposalTypeText: struct{}{},
|
||||
ProposalTypeSoftwareUpgrade: struct{}{},
|
||||
ProposalTypeText: {},
|
||||
ProposalTypeSoftwareUpgrade: {},
|
||||
}
|
||||
|
||||
// RegisterProposalType registers a proposal type. It will panic if the type is
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
amino "github.com/tendermint/go-amino"
|
||||
|
||||
sdkclient "github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/x/mint"
|
||||
"github.com/cosmos/cosmos-sdk/x/mint/client/cli"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/tendermint/go-amino"
|
||||
)
|
||||
|
||||
type ModuleClient struct {
|
||||
|
||||
@ -59,7 +59,7 @@ var paramChangePool = []simParamChange{
|
||||
"MinSignedPerWindow",
|
||||
"",
|
||||
func(r *rand.Rand) string {
|
||||
return fmt.Sprintf("\"%d\"", simulation.ModuleParamSimulator["MinSignedPerWindow"](r).(sdk.Dec))
|
||||
return fmt.Sprintf("\"%s\"", simulation.ModuleParamSimulator["MinSignedPerWindow"](r).(sdk.Dec))
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -67,7 +67,7 @@ var paramChangePool = []simParamChange{
|
||||
"SlashFractionDowntime",
|
||||
"",
|
||||
func(r *rand.Rand) string {
|
||||
return fmt.Sprintf("\"%d\"", simulation.ModuleParamSimulator["SlashFractionDowntime"](r).(sdk.Dec))
|
||||
return fmt.Sprintf("\"%s\"", simulation.ModuleParamSimulator["SlashFractionDowntime"](r).(sdk.Dec))
|
||||
},
|
||||
},
|
||||
// minting parameters
|
||||
@ -76,7 +76,7 @@ var paramChangePool = []simParamChange{
|
||||
"InflationRateChange",
|
||||
"",
|
||||
func(r *rand.Rand) string {
|
||||
return fmt.Sprintf("\"%d\"", simulation.ModuleParamSimulator["InflationRateChange"](r).(sdk.Dec))
|
||||
return fmt.Sprintf("\"%s\"", simulation.ModuleParamSimulator["InflationRateChange"](r).(sdk.Dec))
|
||||
},
|
||||
},
|
||||
// auth parameters
|
||||
|
||||
@ -55,8 +55,8 @@ func (p Params) String() string {
|
||||
SignedBlocksWindow: %d
|
||||
MinSignedPerWindow: %s
|
||||
DowntimeJailDuration: %s
|
||||
SlashFractionDoubleSign: %d
|
||||
SlashFractionDowntime: %d`, p.MaxEvidenceAge,
|
||||
SlashFractionDoubleSign: %s
|
||||
SlashFractionDowntime: %s`, p.MaxEvidenceAge,
|
||||
p.SignedBlocksWindow, p.MinSignedPerWindow,
|
||||
p.DowntimeJailDuration, p.SlashFractionDoubleSign,
|
||||
p.SlashFractionDowntime)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user