diff --git a/.golangci.yml b/.golangci.yml index 316bf3c57e..430440a76f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -31,14 +31,11 @@ linters: - unconvert - unused + + + + issues: - gofumpt: - # Module path which contains the source code being formatted. - # Default: "" - module-path: github.com/cosmos/interchain-security - # Choose whether to use the extra rules. - # Default: false - extra-rules: true exclude-rules: - text: "Use of weak random number generator" linters: @@ -63,6 +60,10 @@ issues: max-same-issues: 10000 linters-settings: + gofumpt: + # Choose whether to use the extra rules. + # Default: false + extra-rules: true gocritic: disabled-checks: - appendAssign diff --git a/tests/difference/core/driver/core_test.go b/tests/difference/core/driver/core_test.go index 265dcd4227..8d54f2560a 100644 --- a/tests/difference/core/driver/core_test.go +++ b/tests/difference/core/driver/core_test.go @@ -151,7 +151,7 @@ func (s *CoreSuite) delegatorBalance() int64 { } // delegate delegates amt tokens to validator val -func (s *CoreSuite) delegate(val int64, amt int64) { +func (s *CoreSuite) delegate(val, amt int64) { server := stakingkeeper.NewMsgServerImpl(s.providerStakingKeeper()) coin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(amt)) d := s.delegator() @@ -163,7 +163,7 @@ func (s *CoreSuite) delegate(val int64, amt int64) { } // undelegate undelegates amt tokens from validator val -func (s *CoreSuite) undelegate(val int64, amt int64) { +func (s *CoreSuite) undelegate(val, amt int64) { server := stakingkeeper.NewMsgServerImpl(s.providerStakingKeeper()) coin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(amt)) d := s.delegator() diff --git a/tests/difference/core/driver/setup.go b/tests/difference/core/driver/setup.go index 349ec74fa5..64611da7cc 100644 --- a/tests/difference/core/driver/setup.go +++ b/tests/difference/core/driver/setup.go @@ -356,7 +356,7 @@ func (b *Builder) setSigningInfos() { // Checks that the lexicographic ordering of validator addresses as computed in // the staking module match the ordering of validators in the model. func (b *Builder) ensureValidatorLexicographicOrderingMatchesModel() { - check := func(lesser sdk.ValAddress, greater sdk.ValAddress) { + check := func(lesser, greater sdk.ValAddress) { lesserV, _ := b.providerStakingKeeper().GetValidator(b.providerCtx(), lesser) greaterV, _ := b.providerStakingKeeper().GetValidator(b.providerCtx(), greater) lesserKey := stakingtypes.GetValidatorsByPowerIndexKey(lesserV, sdk.DefaultPowerReduction) @@ -525,7 +525,7 @@ func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *consume func GetZeroState( suite *suite.Suite, initState InitState, -) (path *ibctesting.Path, addrs []sdk.ValAddress, heightLastCommitted int64, timeLastCommitted int64) { +) (path *ibctesting.Path, addrs []sdk.ValAddress, heightLastCommitted, timeLastCommitted int64) { b := Builder{initState: initState, suite: suite} b.createProviderAndConsumer() diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index f5b8946188..e17d751c24 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -1036,7 +1036,7 @@ func (tr TestRun) invokeDowntimeSlash(action downtimeSlashAction, verbose bool) } // Sets validator downtime by setting the virtual ethernet interface of a node to "up" or "down" -func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, down bool, verbose bool) { +func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, down, verbose bool) { var lastArg string if down { lastArg = "down" diff --git a/tests/integration/common.go b/tests/integration/common.go index 77fa7c30c3..6daff30e02 100644 --- a/tests/integration/common.go +++ b/tests/integration/common.go @@ -112,7 +112,7 @@ func delegateAndUndelegate(s *CCVTestSuite, delAddr sdk.AccAddress, bondAmt sdk. // Note: This function advances blocks in-between operations, where validator powers are // not checked, since they are checked in integration tests. func delegateAndRedelegate(s *CCVTestSuite, delAddr sdk.AccAddress, - srcValAddr sdk.ValAddress, dstValAddr sdk.ValAddress, amount sdk.Int, + srcValAddr, dstValAddr sdk.ValAddress, amount sdk.Int, ) { // Delegate to src validator srcValTokensBefore := s.getVal(s.providerCtx(), srcValAddr).GetBondedTokens() @@ -284,7 +284,7 @@ func incrementTimeByUnbondingPeriod(s *CCVTestSuite, chainType ChainType) { incrementTime(s, jumpPeriod) } -func checkStakingUnbondingOps(s *CCVTestSuite, id uint64, found bool, onHold bool, msgAndArgs ...interface{}) { +func checkStakingUnbondingOps(s *CCVTestSuite, id uint64, found, onHold bool, msgAndArgs ...interface{}) { stakingUnbondingOp, wasFound := getStakingUnbondingDelegationEntry(s.providerCtx(), s.providerApp.GetTestStakingKeeper(), id) s.Require().Equal( found, diff --git a/tests/integration/setup.go b/tests/integration/setup.go index ae7d264df0..3903175214 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -63,7 +63,7 @@ type CCVTestSuite struct { // NewCCVTestSuite returns a new instance of CCVTestSuite, ready to be tested against using suite.Run(). func NewCCVTestSuite[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( - providerAppIniter ibctesting.AppIniter, consumerAppIniter ibctesting.AppIniter, skippedTests []string, + providerAppIniter, consumerAppIniter ibctesting.AppIniter, skippedTests []string, ) *CCVTestSuite { ccvSuite := new(CCVTestSuite) diff --git a/x/ccv/consumer/types/params.go b/x/ccv/consumer/types/params.go index b730c86100..928900b207 100644 --- a/x/ccv/consumer/types/params.go +++ b/x/ccv/consumer/types/params.go @@ -63,7 +63,7 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates new consumer parameters with provided arguments func NewParams(enabled bool, blocksPerDistributionTransmission int64, distributionTransmissionChannel, providerFeePoolAddrStr string, - ccvTimeoutPeriod time.Duration, transferTimeoutPeriod time.Duration, + ccvTimeoutPeriod, transferTimeoutPeriod time.Duration, consumerRedistributionFraction string, historicalEntries int64, consumerUnbondingPeriod time.Duration, softOptOutThreshold string, ) Params { diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 828ae86903..9ef1d594aa 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -196,7 +196,7 @@ func TestCreateConsumerClient(t *testing.T) { // // Note: Separated from TestCreateConsumerClient to also be called from TestCreateConsumerChainProposal. func testCreatedConsumerClient(t *testing.T, - ctx sdk.Context, providerKeeper providerkeeper.Keeper, expectedChainID string, expectedClientID string, + ctx sdk.Context, providerKeeper providerkeeper.Keeper, expectedChainID, expectedClientID string, ) { t.Helper() // ClientID should be stored. @@ -574,7 +574,7 @@ func TestStopConsumerChain(t *testing.T) { // testProviderStateIsCleaned executes test assertions for the proposer's state being cleaned after a stopped consumer chain. func testProviderStateIsCleaned(t *testing.T, ctx sdk.Context, providerKeeper providerkeeper.Keeper, - expectedChainID string, expectedChannelID string, + expectedChainID, expectedChannelID string, ) { t.Helper() _, found := providerKeeper.GetConsumerClientId(ctx, expectedChainID)