lint: official action (#6156)
* switch from review dog to official golangci action * fix release * disable nolintlint and wsl * fix linting issues * have name adhere to required * add timeout Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
9d022c17b7
commit
54ed8d7a2c
|
@ -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 }}
|
||||
|
|
|
@ -34,8 +34,8 @@ linters:
|
|||
- unused
|
||||
- unparam
|
||||
- misspell
|
||||
- wsl
|
||||
- nolintlint
|
||||
# - wsl
|
||||
# - nolintlint
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(),
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue