diff --git a/.golangci.yml b/.golangci.yml index ce8010e7ab..5b39faf1cb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 diff --git a/Makefile b/Makefile index f1d979b3ea..759fed493e 100644 --- a/Makefile +++ b/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 diff --git a/client/rpc/status.go b/client/rpc/status.go index e96889a784..62cd7835f2 100644 --- a/client/rpc/status.go +++ b/client/rpc/status.go @@ -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) } diff --git a/cmd/gaia/Makefile b/cmd/gaia/Makefile index bc57dcc784..024e0d318d 100644 --- a/cmd/gaia/Makefile +++ b/cmd/gaia/Makefile @@ -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 diff --git a/cmd/gaia/lcd_test/helpers_test.go b/cmd/gaia/lcd_test/helpers_test.go index 463b0bd473..51deefa52a 100644 --- a/cmd/gaia/lcd_test/helpers_test.go +++ b/cmd/gaia/lcd_test/helpers_test.go @@ -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" diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile index 72b494195f..e07d16f4b1 100644 --- a/contrib/devtools/Makefile +++ b/contrib/devtools/Makefile @@ -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 ### diff --git a/crypto/ledger_mock.go b/crypto/ledger_mock.go index 159d9c2d37..cf68cd404c 100644 --- a/crypto/ledger_mock.go +++ b/crypto/ledger_mock.go @@ -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" diff --git a/x/auth/ante.go b/x/auth/ante.go index c7021e10bd..762ed310ff 100644 --- a/x/auth/ante.go +++ b/x/auth/ante.go @@ -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" diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index 8088586eca..ef18eaf15c 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -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 diff --git a/x/mint/client/module_client.go b/x/mint/client/module_client.go index e77cd92050..4a22b6e763 100644 --- a/x/mint/client/module_client.go +++ b/x/mint/client/module_client.go @@ -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 { diff --git a/x/params/simulation/msgs.go b/x/params/simulation/msgs.go index 1771baff1c..b198db8573 100644 --- a/x/params/simulation/msgs.go +++ b/x/params/simulation/msgs.go @@ -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 diff --git a/x/slashing/params.go b/x/slashing/params.go index 5a4f18f167..0ec5386f26 100644 --- a/x/slashing/params.go +++ b/x/slashing/params.go @@ -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)