Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update linters #1008

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v4

- name: golangci-lint-junod
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout 10m
2 changes: 1 addition & 1 deletion .github/workflows/interchaintest-E2E.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Retry Failed Test
if: steps.run_test.outcome == 'failure'
run: |
for i in 1 2; do
for i in 1 2 3; do
echo "Retry attempt $i"
if make ${{ matrix.test }}; then
echo "Test passed on retry"
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ linters:
disable-all: true
enable:
- bodyclose
- copyloopvar
- dogsled
- errcheck
- goconst
Expand All @@ -18,6 +19,7 @@ linters:
- gosimple
- govet
- ineffassign
- maintidx
- misspell
- nakedret
- exportloopref
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ type AppKeepers struct {
HooksICS4Wrapper ibc_hooks.ICS4Middleware
}

func NewAppKeepers(
func NewAppKeepers( //nolint:maintidx // TODO: make this function less complex so it doesn't trigger the maintainability index
appCodec codec.Codec,
bApp *baseapp.BaseApp,
cdc *codec.LegacyAmino,
Expand Down
1 change: 0 additions & 1 deletion app/upgrades/v16/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func CreateV16UpgradeHandler(
// https://github.com/cosmos/cosmos-sdk/pull/12363/files
// Set param key table for params module migration
for _, subspace := range keepers.ParamsKeeper.GetSubspaces() {
subspace := subspace

var keyTable paramstypes.KeyTable
switch subspace.Name() {
Expand Down
1 change: 0 additions & 1 deletion app/upgrades/v17/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func migrateChainOwnedSubDaos(ctx sdk.Context, logger log.Logger, ak authkeeper.
distrAddr := ak.GetModuleAddress(distrtypes.ModuleName)

for _, dao := range subDaos {
dao := dao
logger.Info("migrating " + dao + " to the gov module")

cAddr := sdk.MustAccAddressFromBech32(dao)
Expand Down
1 change: 0 additions & 1 deletion app/upgrades/v23/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func CreateV23UpgradeHandler(

// migrate ICQ params
for _, subspace := range keepers.ParamsKeeper.GetSubspaces() {
subspace := subspace

var keyTable paramstypes.KeyTable
if subspace.Name() == icqtypes.ModuleName {
Expand Down
3 changes: 0 additions & 3 deletions x/clock/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (s *IntegrationTestSuite) TestRegisterClockContract() {
success: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
// Set params
params := types.DefaultParams()
Expand Down Expand Up @@ -158,7 +157,6 @@ func (s *IntegrationTestSuite) TestUnregisterClockContract() {
success: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
s.RegisterClockContract(addr.String(), contractAddress)
s.RegisterClockContract(addr2.String(), contractAddressWithAdmin)
Expand Down Expand Up @@ -284,7 +282,6 @@ func (s *IntegrationTestSuite) TestUnjailClockContract() {
success: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
s.RegisterClockContract(addr.String(), contractAddress)
s.JailClockContract(contractAddress)
Expand Down
4 changes: 0 additions & 4 deletions x/clock/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func (s *IntegrationTestSuite) TestQueryClockParams() {
},
},
} {
tc := tc
s.Run(tc.desc, func() {
// Set params
err := s.app.AppKeepers.ClockKeeper.SetParams(s.ctx, tc.params)
Expand Down Expand Up @@ -78,7 +77,6 @@ func (s *IntegrationTestSuite) TestQueryClockContracts() {
},
},
} {
tc := tc
s.Run(tc.desc, func() {
// Loop through contracts & register
for _, contract := range tc.contracts {
Expand Down Expand Up @@ -135,7 +133,6 @@ func (s *IntegrationTestSuite) TestQueryJailedClockContracts() {
},
},
} {
tc := tc
s.Run(tc.desc, func() {
// Loop through contracts & register
for _, contract := range tc.contracts {
Expand Down Expand Up @@ -214,7 +211,6 @@ func (s *IntegrationTestSuite) TestQueryClockContract() {
success: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
// Query contract
resp, err := s.queryClient.ClockContract(s.ctx, &types.QueryClockContract{
Expand Down
2 changes: 0 additions & 2 deletions x/cw-hooks/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func (s *IntegrationTestSuite) TestRegisterContracts() {
shouldErr: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
goCtx := sdk.WrapSDKContext(s.ctx)
// staking
Expand Down Expand Up @@ -166,7 +165,6 @@ func (s *IntegrationTestSuite) TestUnRegisterContracts() {
shouldErr: true,
},
} {
tc := tc
s.Run(tc.desc, func() {
goCtx := sdk.WrapSDKContext(s.ctx)
// staking
Expand Down
1 change: 0 additions & 1 deletion x/drip/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func (s *IntegrationTestSuite) TestDripQueryParams() {
},
},
} {
tc := tc
s.Run(tc.desc, func() {
// Set the params to what is expected, then query and ensure the query is the same
err := s.app.AppKeepers.DripKeeper.SetParams(s.ctx, tc.Expected)
Expand Down
2 changes: 0 additions & 2 deletions x/drip/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func (s *IntegrationTestSuite) TestDripDistributeTokensMsgs() {
success: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
msg := types.MsgDistributeTokens{
SenderAddress: tc.senderAddr,
Expand Down Expand Up @@ -135,7 +134,6 @@ func (s *IntegrationTestSuite) TestUpdateDripParams() {
success: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
params := types.Params{
EnableDrip: tc.isEnabled,
Expand Down
8 changes: 0 additions & 8 deletions x/feepay/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ func (s *IntegrationTestSuite) TestRegisterFeePayContract() {
shouldErr: true,
},
} {
tc := tc

s.Run(tc.desc, func() {
_, err := s.app.AppKeepers.FeePayKeeper.RegisterFeePayContract(s.ctx, &types.MsgRegisterFeePayContract{
SenderAddress: tc.senderAddress,
Expand Down Expand Up @@ -138,8 +136,6 @@ func (s *IntegrationTestSuite) TestUnregisterFeePayContract() {
shouldErr: true,
},
} {
tc := tc

s.Run(tc.desc, func() {
_, err := s.app.AppKeepers.FeePayKeeper.UnregisterFeePayContract(s.ctx, &types.MsgUnregisterFeePayContract{
SenderAddress: tc.senderAddress,
Expand Down Expand Up @@ -208,8 +204,6 @@ func (s *IntegrationTestSuite) TestFundFeePayContract() {
shouldErr: false,
},
} {
tc := tc

s.Run(tc.desc, func() {
_, err := s.app.AppKeepers.FeePayKeeper.FundFeePayContract(s.ctx, &types.MsgFundFeePayContract{
SenderAddress: tc.senderAddress,
Expand Down Expand Up @@ -295,8 +289,6 @@ func (s *IntegrationTestSuite) TestUpdateFeePayContractWalletLimit() {
shouldErr: false,
},
} {
tc := tc

s.Run(tc.desc, func() {
_, err := s.app.AppKeepers.FeePayKeeper.UpdateFeePayContractWalletLimit(s.ctx, &types.MsgUpdateFeePayContractWalletLimit{
SenderAddress: tc.senderAddress,
Expand Down
1 change: 0 additions & 1 deletion x/feepay/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func (s *IntegrationTestSuite) TestQueryContractBalance() {
{balance: 0},
{balance: 1_000_000},
} {
bal := bal

// Instantiate the contractAddr
contractAddr := s.InstantiateContract(sender.String(), "")
Expand Down
4 changes: 0 additions & 4 deletions x/feeshare/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func (s *IntegrationTestSuite) TestGetContractAdminOrCreatorAddress() {
shouldErr: true,
},
} {
tc := tc
s.Run(tc.desc, func() {
if !tc.shouldErr {
_, err := s.app.AppKeepers.FeeShareKeeper.GetContractAdminOrCreatorAddress(s.ctx, sdk.MustAccAddressFromBech32(tc.contractAddress), tc.deployerAddress)
Expand Down Expand Up @@ -222,7 +221,6 @@ func (s *IntegrationTestSuite) TestRegisterFeeShare() {
shouldErr: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
goCtx := sdk.WrapSDKContext(s.ctx)
if !tc.shouldErr {
Expand Down Expand Up @@ -317,7 +315,6 @@ func (s *IntegrationTestSuite) TestUpdateFeeShare() {
shouldErr: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
goCtx := sdk.WrapSDKContext(s.ctx)
if !tc.shouldErr {
Expand Down Expand Up @@ -383,7 +380,6 @@ func (s *IntegrationTestSuite) TestCancelFeeShare() {
shouldErr: false,
},
} {
tc := tc
s.Run(tc.desc, func() {
goCtx := sdk.WrapSDKContext(s.ctx)
if !tc.shouldErr {
Expand Down
6 changes: 0 additions & 6 deletions x/mint/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ mint_denom: stake`,
}

for _, tc := range testCases {
tc := tc

s.Run(tc.name, func() {
cmd := cli.GetCmdQueryParams()
clientCtx := val.ClientCtx
Expand Down Expand Up @@ -113,8 +111,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryInflation() {
}

for _, tc := range testCases {
tc := tc

s.Run(tc.name, func() {
cmd := cli.GetCmdQueryInflation()
clientCtx := val.ClientCtx
Expand Down Expand Up @@ -147,8 +143,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryAnnualProvisions() {
}

for _, tc := range testCases {
tc := tc

s.Run(tc.name, func() {
cmd := cli.GetCmdQueryAnnualProvisions()
clientCtx := val.ClientCtx
Expand Down
1 change: 0 additions & 1 deletion x/mint/simulation/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func TestDecodeStore(t *testing.T) {
}

for i, tt := range tests {
i, tt := i, tt
t.Run(tt.name, func(t *testing.T) {
switch i {
case len(tests) - 1:
Expand Down
1 change: 0 additions & 1 deletion x/mint/simulation/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func TestRandomizedGenState1(t *testing.T) {
}

for _, tt := range tests {
tt := tt
require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg)
}
}
2 changes: 0 additions & 2 deletions x/tokenfactory/bindings/validate_queries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ func TestDenomAdmin(t *testing.T) {
}

for _, tc := range testCases {
tc := tc

t.Run(tc.name, func(t *testing.T) {
resp, err := queryPlugin.GetDenomAdmin(ctx, tc.denom)
if tc.expectErr {
Expand Down
Loading