chore: fixes a batch of lint issues#282
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis pull request primarily adds Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
tests/e2e/e2e_bank_test.go (1)
61-62: ReplaceIsEqualinstead of silencing it.These assertions still use
sdk.Coin.IsEqual, which is deprecated. If you materialize the expected coin in a local variable first, you can compare withCoin.Equaland drop the//nolint:staticcheckmarkers entirely;Equalis a pointer-receiver method, so it can't be called directly on the chainedSub/Addresult. (pkg.go.dev)Suggested pattern
- decremented := beforeAliceAKiiBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterAliceAKiiBalance) //nolint:staticcheck - incremented := beforeBobAkiiBalance.Add(tokenAmount).IsEqual(afterBobUAKiiBalance) //nolint:staticcheck + expectedAlice := beforeAliceAKiiBalance.Sub(tokenAmount).Sub(standardFees) + expectedBob := beforeBobAkiiBalance.Add(tokenAmount) + decremented := expectedAlice.Equal(afterAliceAKiiBalance) + incremented := expectedBob.Equal(afterBobUAKiiBalance)Apply the same pattern to the multi-send assertion below.
Also applies to: 87-89
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/e2e_bank_test.go` around lines 61 - 62, The test uses the deprecated sdk.Coin.IsEqual with chained Sub/Add results and silences the linter; instead, compute the expected coins into local variables (e.g. expectedAlice := beforeAliceAKiiBalance.Sub(tokenAmount).Sub(standardFees) and expectedBob := beforeBobAkiiBalance.Add(tokenAmount)), then call the pointer-receiver method Equal on the resulting coins (expectedAlice.Equal(&afterAliceAKiiBalance) or expectedAlice.Equal(&afterAliceAKiiBalance) as appropriate) and remove the //nolint:staticcheck markers; apply the same pattern for the multi-send assertions around the later lines.tests/e2e/e2e_gov_test.go (1)
128-128: UseCoin.Equalhere too.
sdk.Coin.IsEqualis deprecated, so this line is just hiding the SDK warning. Build the expected post-proposal balance first and compare withEqualinstead. (pkg.go.dev)Suggested cleanup
- return afterRecipientBalance.Sub(sendAmount).IsEqual(beforeRecipientBalance) //nolint:staticcheck + expectedRecipientBalance := beforeRecipientBalance.Add(sendAmount) + return expectedRecipientBalance.Equal(afterRecipientBalance)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/e2e_gov_test.go` at line 128, Replace the deprecated sdk.Coin.IsEqual usage: compute the expected post-send balance by calling beforeRecipientBalance.Add(sendAmount) (store in a variable like expectedAfterRecipientBalance) and then compare with Equal, i.e. return afterRecipientBalance.Equal(expectedAfterRecipientBalance); reference the variables afterRecipientBalance, beforeRecipientBalance, sendAmount and the Coin.Equal method.app/modules.go (1)
94-95: Keep the suppression off the whole module list.These two
//nolint:staticcheckannotations now live on the helper that aggregates every module. Hiding the deprecated SDK type behind a one-line local alias would keep the suppression contained and leave the actual module list fully linted.module.AppModuleis deprecated in the SDK. (pkg.go.dev)One way to contain the suppression
+type legacyAppModule = module.AppModule //nolint:staticcheck + func appModules( app *KiichainApp, appCodec codec.Codec, txConfig client.TxEncodingConfig, tmLightClientModule ibctm.LightClientModule, -) []module.AppModule { //nolint:staticcheck - return []module.AppModule{ //nolint:staticcheck +) []legacyAppModule { + return []legacyAppModule{🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/modules.go` around lines 94 - 95, The module list currently suppresses staticcheck at the return type (return []module.AppModule{ //nolint:staticcheck), which hides use of the deprecated SDK type for the entire list; instead, create a one-line local alias for the deprecated type (e.g., define a local type name that equals module.AppModule) and attach the //nolint:staticcheck to that alias declaration, then change the function signature/return to use the new local alias for the slice (and remove the inline //nolint from the literal), so the suppression is contained to the alias while the actual module list remains fully linted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/modules.go`:
- Around line 94-95: The module list currently suppresses staticcheck at the
return type (return []module.AppModule{ //nolint:staticcheck), which hides use
of the deprecated SDK type for the entire list; instead, create a one-line local
alias for the deprecated type (e.g., define a local type name that equals
module.AppModule) and attach the //nolint:staticcheck to that alias declaration,
then change the function signature/return to use the new local alias for the
slice (and remove the inline //nolint from the literal), so the suppression is
contained to the alias while the actual module list remains fully linted.
In `@tests/e2e/e2e_bank_test.go`:
- Around line 61-62: The test uses the deprecated sdk.Coin.IsEqual with chained
Sub/Add results and silences the linter; instead, compute the expected coins
into local variables (e.g. expectedAlice :=
beforeAliceAKiiBalance.Sub(tokenAmount).Sub(standardFees) and expectedBob :=
beforeBobAkiiBalance.Add(tokenAmount)), then call the pointer-receiver method
Equal on the resulting coins (expectedAlice.Equal(&afterAliceAKiiBalance) or
expectedAlice.Equal(&afterAliceAKiiBalance) as appropriate) and remove the
//nolint:staticcheck markers; apply the same pattern for the multi-send
assertions around the later lines.
In `@tests/e2e/e2e_gov_test.go`:
- Line 128: Replace the deprecated sdk.Coin.IsEqual usage: compute the expected
post-send balance by calling beforeRecipientBalance.Add(sendAmount) (store in a
variable like expectedAfterRecipientBalance) and then compare with Equal, i.e.
return afterRecipientBalance.Equal(expectedAfterRecipientBalance); reference the
variables afterRecipientBalance, beforeRecipientBalance, sendAmount and the
Coin.Equal method.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 98388eee-1129-407f-9c4d-9a5f5fb1c088
📒 Files selected for processing (13)
app/modules.goapp/sim_test.gocmd/kiichaind/cmd/root.gotests/e2e/e2e_bank_test.gotests/e2e/e2e_gov_test.gotests/e2e/e2e_ibc_test.gox/feeabstraction/module.gox/oracle/module.gox/rewards/module.gox/tokenfactory/keeper/createdenom_test.gox/tokenfactory/module.gox/tokenfactory/testhelpers/authz.gox/tokenfactory/types/msgs.go
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Description
Applies linting
Type of change