diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index de3126982..b5e2c89ac 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,12 +1,14 @@ name: Lint on: [pull_request] jobs: - golangci-lint: + golangci: + name: golangci-lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 + - uses: actions/checkout@v2 + - uses: golangci/golangci-lint-action@master with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-review + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: v1.26 + args: --timeout 10m + github-token: ${{ secrets.github_token }} diff --git a/.golangci.yml b/.golangci.yml index a4ad875a7..3aea82880 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -34,8 +34,8 @@ linters: - unused - unparam - misspell - - wsl - - nolintlint + # - wsl + # - nolintlint issues: exclude-rules: diff --git a/simapp/utils.go b/simapp/utils.go index 1b89e4e02..6ac89055d 100644 --- a/simapp/utils.go +++ b/simapp/utils.go @@ -81,7 +81,7 @@ func CheckExportSimulation( return err } - if err := ioutil.WriteFile(config.ExportStatePath, []byte(appState), 0644); err != nil { + if err := ioutil.WriteFile(config.ExportStatePath, []byte(appState), 0600); err != nil { return err } } @@ -93,7 +93,7 @@ func CheckExportSimulation( return err } - if err := ioutil.WriteFile(config.ExportParamsPath, paramsBz, 0644); err != nil { + if err := ioutil.WriteFile(config.ExportParamsPath, paramsBz, 0600); err != nil { return err } } diff --git a/x/auth/alias.go b/x/auth/alias.go index f8ffe899c..01392a61d 100644 --- a/x/auth/alias.go +++ b/x/auth/alias.go @@ -53,7 +53,7 @@ var ( NewQueryAccountParams = types.NewQueryAccountParams NewStdTx = types.NewStdTx CountSubKeys = types.CountSubKeys - NewStdFee = types.NewStdFee + NewStdFee = types.NewStdFee //nolint:staticcheck StdSignBytes = types.StdSignBytes DefaultTxDecoder = types.DefaultTxDecoder DefaultTxEncoder = types.DefaultTxEncoder @@ -88,9 +88,9 @@ type ( QueryAccountParams = types.QueryAccountParams StdSignMsg = types.StdSignMsg StdTx = types.StdTx - StdFee = types.StdFee + StdFee = types.StdFee //nolint:staticcheck StdSignDoc = types.StdSignDoc - StdSignature = types.StdSignature + StdSignature = types.StdSignature //nolint:staticcheck TxBuilder = types.TxBuilder GenesisAccountIterator = types.GenesisAccountIterator Codec = types.Codec diff --git a/x/auth/ante/basic.go b/x/auth/ante/basic.go index d349e2c4b..41ba96d8b 100644 --- a/x/auth/ante/basic.go +++ b/x/auth/ante/basic.go @@ -126,7 +126,7 @@ func (cgts ConsumeTxSizeGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim } // use stdsignature to mock the size of a full signature - simSig := types.StdSignature{ + simSig := types.StdSignature{ //nolint:staticcheck Signature: simSecp256k1Sig[:], PubKey: pubkey.Bytes(), } diff --git a/x/auth/client/cli/tx_multisign.go b/x/auth/client/cli/tx_multisign.go index e0d502a47..71375da72 100644 --- a/x/auth/client/cli/tx_multisign.go +++ b/x/auth/client/cli/tx_multisign.go @@ -113,8 +113,8 @@ func makeMultiSignCmd(cdc *codec.Codec) func(cmd *cobra.Command, args []string) } } - newStdSig := types.StdSignature{Signature: cdc.MustMarshalBinaryBare(multisigSig), PubKey: multisigPub.Bytes()} - newTx := types.NewStdTx(stdTx.GetMsgs(), stdTx.Fee, []types.StdSignature{newStdSig}, stdTx.GetMemo()) + newStdSig := types.StdSignature{Signature: cdc.MustMarshalBinaryBare(multisigSig), PubKey: multisigPub.Bytes()} //nolint:staticcheck + newTx := types.NewStdTx(stdTx.GetMsgs(), stdTx.Fee, []types.StdSignature{newStdSig}, stdTx.GetMemo()) //nolint:staticcheck sigOnly := viper.GetBool(flagSigOnly) var json []byte @@ -151,7 +151,7 @@ func makeMultiSignCmd(cdc *codec.Codec) func(cmd *cobra.Command, args []string) } } -func readAndUnmarshalStdSignature(cdc *codec.Codec, filename string) (stdSig types.StdSignature, err error) { +func readAndUnmarshalStdSignature(cdc *codec.Codec, filename string) (stdSig types.StdSignature, err error) { //nolint:staticcheck var bytes []byte if bytes, err = ioutil.ReadFile(filename); err != nil { return diff --git a/x/auth/client/cli/tx_sign.go b/x/auth/client/cli/tx_sign.go index cb49bdeb7..dc118974a 100644 --- a/x/auth/client/cli/tx_sign.go +++ b/x/auth/client/cli/tx_sign.go @@ -15,11 +15,10 @@ import ( ) const ( - flagMultisig = "multisig" - flagAppend = "append" - flagValidateSigs = "validate-signatures" - flagSigOnly = "signature-only" - flagOutfile = "output-document" + flagMultisig = "multisig" + flagAppend = "append" + flagSigOnly = "signature-only" + flagOutfile = "output-document" ) // GetSignCommand returns the transaction sign command. diff --git a/x/simulation/event_stats.go b/x/simulation/event_stats.go index 1a6201aac..0e4289fd2 100644 --- a/x/simulation/event_stats.go +++ b/x/simulation/event_stats.go @@ -48,7 +48,7 @@ func (es EventStats) ExportJSON(path string) { panic(err) } - err = ioutil.WriteFile(path, bz, 0644) + err = ioutil.WriteFile(path, bz, 0600) if err != nil { panic(err) } diff --git a/x/slashing/client/cli/cli_test.go b/x/slashing/client/cli/cli_test.go index 326c73d1f..4c94b54d1 100644 --- a/x/slashing/client/cli/cli_test.go +++ b/x/slashing/client/cli/cli_test.go @@ -5,12 +5,11 @@ package cli_test import ( "testing" - "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/x/slashing/client/testutil" cli "github.com/cosmos/cosmos-sdk/tests/cli" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/slashing/client/testutil" ) func TestCLISlashingGetParams(t *testing.T) { diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index a5bed9e36..fc3ad6ed1 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -160,7 +160,7 @@ func (k Keeper) DumpUpgradeInfoToDisk(height int64, name string) error { return err } - return ioutil.WriteFile(upgradeInfoFilePath, info, 0644) + return ioutil.WriteFile(upgradeInfoFilePath, info, 0600) } // GetUpgradeInfoPath returns the upgrade info file path