-
Notifications
You must be signed in to change notification settings - Fork 906
chore(go-lint): fix linter errors #2764
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
Conversation
WalkthroughThe recent changes primarily enhance error handling across several files, focusing on improving the clarity and consistency of error messages. By employing simpler error creation methods and refining the formatting, these updates bolster logging and debugging capabilities without affecting existing functionality or public entity declarations. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant System
participant Logger
User->>System: Send request
System->>Logger: Log request details
System->>System: Process request
alt Error Handling
System->>Logger: Log error with context
end
Logger->>User: Return response
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 Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- app/ante/cosmos/authz.go (1 hunks)
- app/tps_counter_test.go (1 hunks)
- ibc/utils.go (1 hunks)
- precompiles/authorization/types.go (3 hunks)
- precompiles/common/precompile.go (2 hunks)
- precompiles/erc20/tx.go (1 hunks)
- precompiles/ics20/types.go (3 hunks)
- precompiles/staking/tx.go (3 hunks)
- precompiles/testutil/logs.go (1 hunks)
- tests/e2e/upgrade/manager.go (2 hunks)
- testutil/abci.go (2 hunks)
Files skipped from review due to trivial changes (6)
- app/ante/cosmos/authz.go
- app/tps_counter_test.go
- ibc/utils.go
- precompiles/staking/tx.go
- precompiles/testutil/logs.go
- tests/e2e/upgrade/manager.go
Additional comments not posted (11)
precompiles/erc20/tx.go (1)
100-100
: Improved error message clarity.The error message in the
transfer
function has been enhanced by prepending "error: " to the original error message. This improves the clarity and context of the error output, aiding in debugging.precompiles/authorization/types.go (3)
7-7
: Simplified error handling witherrors.New
.The addition of the
errors
import allows for the use oferrors.New
, simplifying the creation of static error messages and improving readability.
78-78
: Simplified static error message creation.The use of
errors.New
for static error messages inCheckApprovalArgs
improves readability by removing unnecessary formatting.
195-195
: Simplified static error message creation.In
validateMsgTypes
, the use oferrors.New
for static error messages simplifies the code by removing unnecessary formatting.testutil/abci.go (2)
190-190
: Enhanced error message clarity inBroadcastTxBytes
.The error message now includes "log: " before the response log content, improving clarity and aiding in debugging.
237-237
: Enhanced error message clarity incheckTxBytes
.The error message now includes "log: " before the response log content, improving clarity and aiding in debugging.
precompiles/common/precompile.go (1)
81-81
: Simplified error creation is appropriate.The use of
errors.New
instead offmt.Errorf
is suitable here since the error message is static and does not require formatting.precompiles/ics20/types.go (4)
111-111
: Improved error handling forsourcePort
.The change from
fmt.Errorf
toerrors.New
for theErrInvalidSourcePort
error is appropriate, as the error message does not require formatting.
116-116
: Improved error handling forsourceChannel
.The change from
fmt.Errorf
toerrors.New
for theErrInvalidSourceChannel
error is appropriate, as the error message does not require formatting.
276-276
: Improved error handling forsourcePort
incheckAllowanceArgs
.The change from
fmt.Errorf
toerrors.New
for theErrInvalidSourcePort
error is appropriate, as the error message does not require formatting.
281-281
: Improved error handling forsourceChannel
incheckAllowanceArgs
.The change from
fmt.Errorf
toerrors.New
for theErrInvalidSourceChannel
error is appropriate, as the error message does not require formatting.
Signed-off-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- app/ante/cosmos/authz.go (1 hunks)
- precompiles/erc20/tx.go (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- app/ante/cosmos/authz.go
- precompiles/erc20/tx.go
✅ Backports have been created
|
* fix linter errors * Apply suggestions from code review Signed-off-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --------- Signed-off-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> (cherry picked from commit 8ad527d) # Conflicts: # app/ante/cosmos/authz.go # app/tps_counter_test.go # ibc/utils.go # precompiles/authorization/types.go # precompiles/common/precompile.go # precompiles/erc20/tx.go # precompiles/ics20/types.go # precompiles/staking/tx.go # precompiles/testutil/logs.go # tests/e2e/upgrade/manager.go # testutil/abci.go
* chore(go-lint): fix linter errors (#2764) * fix linter errors * Apply suggestions from code review Signed-off-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --------- Signed-off-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> (cherry picked from commit 8ad527d) # Conflicts: # app/ante/cosmos/authz.go # app/tps_counter_test.go # ibc/utils.go # precompiles/authorization/types.go # precompiles/common/precompile.go # precompiles/erc20/tx.go # precompiles/ics20/types.go # precompiles/staking/tx.go # precompiles/testutil/logs.go # tests/e2e/upgrade/manager.go # testutil/abci.go * fix conflicts * run make format * fix lint --------- Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com> Co-authored-by: Vlad <vladislav.varadinov@gmail.com> Co-authored-by: Vvaradinov <Vvaradinov@users.noreply.github.com>
Description
The golangci-lint version was bumped to v1.60.1. Now we have new linter errors.
This PR addresses those
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
Reviewers Checklist
All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.
I have...
Unreleased
section inCHANGELOG.md
Summary by CodeRabbit
New Features
Bug Fixes
These changes improve user experience by making errors more understandable and facilitating easier debugging.