refactor: replaced fmt.Sprintf with strconv.FormatBool for boolean conversions#6516
Conversation
WalkthroughThe changes focus on improving the conversion of boolean values to strings within the codebase. Specifically, the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 4
Outside diff range and nitpick comments (3)
modules/apps/27-interchain-accounts/controller/keeper/events.go (1)
Line range hint
4-4: Remove unused import to clean up the code.- import ( - "fmt"Tools
GitHub Check: tests (03)
[failure] 19-19:
undefined: strconvGitHub Check: tests (02)
[failure] 19-19:
undefined: strconv
[failure] 19-19:
undefined: strconvGitHub Check: tests (01)
[failure] 19-19:
undefined: strconvGitHub Check: tests (00)
[failure] 19-19:
undefined: strconv
[failure] 19-19:
undefined: strconvGitHub Check: build (arm64)
[failure] 19-19:
undefined: strconvGitHub Check: build (amd64)
[failure] 19-19:
undefined: strconvGitHub Check: lint
[failure] 19-19:
undefined: strconv) (typecheck)modules/apps/27-interchain-accounts/host/keeper/events.go (1)
Line range hint
4-4: Remove unused import to clean up the code.- import ( - "fmt"Tools
GitHub Check: tests (03)
[failure] 20-20:
undefined: strconvGitHub Check: tests (02)
[failure] 20-20:
undefined: strconv
[failure] 20-20:
undefined: strconvGitHub Check: tests (01)
[failure] 20-20:
undefined: strconvGitHub Check: tests (00)
[failure] 20-20:
undefined: strconv
[failure] 20-20:
undefined: strconvGitHub Check: build (arm64)
[failure] 20-20:
undefined: strconvGitHub Check: build (amd64)
[failure] 20-20:
undefined: strconvGitHub Check: lint
[failure] 20-20:
undefined: strconv) (typecheck)
[failure] 20-20:
undefined: strconv) (typecheck)modules/apps/transfer/internal/events/events.go (1)
Line range hint
5-5: Remove unused import to clean up the code.- import ( - "fmt"Tools
GitHub Check: tests (03)
[failure] 41-41:
undefined: strconvGitHub Check: tests (02)
[failure] 41-41:
undefined: strconvGitHub Check: tests (01)
[failure] 41-41:
undefined: strconv
[failure] 41-41:
undefined: strconvGitHub Check: tests (00)
[failure] 41-41:
undefined: strconvGitHub Check: build (arm64)
[failure] 41-41:
undefined: strconvGitHub Check: build (amd64)
[failure] 41-41:
undefined: strconv
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (5)
- modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go (1 hunks)
- modules/apps/27-interchain-accounts/controller/keeper/events.go (1 hunks)
- modules/apps/27-interchain-accounts/host/ibc_module_test.go (1 hunks)
- modules/apps/27-interchain-accounts/host/keeper/events.go (1 hunks)
- modules/apps/transfer/internal/events/events.go (1 hunks)
Additional context used
Path-based instructions (5)
modules/apps/27-interchain-accounts/controller/keeper/events.go (1)
Pattern
**/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.modules/apps/27-interchain-accounts/host/keeper/events.go (1)
Pattern
**/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.modules/apps/transfer/internal/events/events.go (1)
Pattern
**/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.modules/apps/27-interchain-accounts/host/ibc_module_test.go (2)
Pattern
**/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go (2)
Pattern
**/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"
GitHub Check: tests (03)
modules/apps/27-interchain-accounts/controller/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconvmodules/apps/27-interchain-accounts/host/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconvmodules/apps/transfer/internal/events/events.go
[failure] 5-5:
"fmt" imported and not used
[failure] 41-41:
undefined: strconv
GitHub Check: tests (02)
modules/apps/27-interchain-accounts/controller/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconv
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconvmodules/apps/27-interchain-accounts/host/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconv
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconvmodules/apps/transfer/internal/events/events.go
[failure] 5-5:
"fmt" imported and not used
[failure] 41-41:
undefined: strconv
GitHub Check: tests (01)
modules/apps/27-interchain-accounts/controller/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconvmodules/apps/27-interchain-accounts/host/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconvmodules/apps/transfer/internal/events/events.go
[failure] 5-5:
"fmt" imported and not used
[failure] 41-41:
undefined: strconv
[failure] 5-5:
"fmt" imported and not used
[failure] 41-41:
undefined: strconv
GitHub Check: tests (00)
modules/apps/27-interchain-accounts/controller/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconv
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconvmodules/apps/27-interchain-accounts/host/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconv
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconvmodules/apps/transfer/internal/events/events.go
[failure] 5-5:
"fmt" imported and not used
[failure] 41-41:
undefined: strconv
GitHub Check: build (arm64)
modules/apps/27-interchain-accounts/controller/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconvmodules/apps/27-interchain-accounts/host/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconvmodules/apps/transfer/internal/events/events.go
[failure] 5-5:
"fmt" imported and not used
[failure] 41-41:
undefined: strconv
GitHub Check: build (amd64)
modules/apps/27-interchain-accounts/controller/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconvmodules/apps/27-interchain-accounts/host/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconvmodules/apps/transfer/internal/events/events.go
[failure] 5-5:
"fmt" imported and not used
[failure] 41-41:
undefined: strconv
GitHub Check: lint
modules/apps/27-interchain-accounts/controller/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 19-19:
undefined: strconv) (typecheck)modules/apps/27-interchain-accounts/host/keeper/events.go
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconv) (typecheck)
[failure] 4-4:
"fmt" imported and not used
[failure] 20-20:
undefined: strconv) (typecheck)
| sdk.NewAttribute(sdk.AttributeKeyModule, icatypes.ModuleName), | ||
| sdk.NewAttribute(icatypes.AttributeKeyControllerChannelID, packet.GetDestChannel()), | ||
| sdk.NewAttribute(icatypes.AttributeKeyAckSuccess, fmt.Sprintf("%t", false)), | ||
| sdk.NewAttribute(icatypes.AttributeKeyAckSuccess, strconv.FormatBool(false)), |
There was a problem hiding this comment.
Replace fmt.Sprintf with strconv.FormatBool for boolean conversion.
- sdk.NewAttribute(icatypes.AttributeKeyAckSuccess, fmt.Sprintf("%t", ack.Success()))
+ sdk.NewAttribute(icatypes.AttributeKeyAckSuccess, strconv.FormatBool(ack.Success()))Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| sdk.NewAttribute(icatypes.AttributeKeyAckSuccess, strconv.FormatBool(false)), | |
| sdk.NewAttribute(icatypes.AttributeKeyAckSuccess, strconv.FormatBool(false)), |
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (5)
- modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go (2 hunks)
- modules/apps/27-interchain-accounts/controller/keeper/events.go (2 hunks)
- modules/apps/27-interchain-accounts/host/ibc_module_test.go (2 hunks)
- modules/apps/27-interchain-accounts/host/keeper/events.go (2 hunks)
- modules/apps/transfer/internal/events/events.go (2 hunks)
Files skipped from review as they are similar to previous changes (5)
- modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go
- modules/apps/27-interchain-accounts/controller/keeper/events.go
- modules/apps/27-interchain-accounts/host/ibc_module_test.go
- modules/apps/27-interchain-accounts/host/keeper/events.go
- modules/apps/transfer/internal/events/events.go
crodriguezvega
left a comment
There was a problem hiding this comment.
Thank you, @MukulKolpe!
|
Thanks @DimitrisJim, @crodriguezvega! |
Description
Replaced
fmt.Sprintfwithstrconv.FormatBoolfor all instances of boolean conversion.For reference - #6442 (comment).
closes: #6449
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/).godoccomments.Files changedin the GitHub PR explorer.SonarCloud Reportin the comment section below once CI passes.Summary by CodeRabbit