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(all): replace all fmt.Errorf without paramters with errors.New #21068

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

yukionfire
Copy link
Contributor

@yukionfire yukionfire commented Jul 25, 2024

Similar to #21032

This PR cleans up all fmt.Errorf without parameters with errors.New among whole codebase

Summary by CodeRabbit

  • Bug Fixes
    • Simplified error handling across various functions by replacing fmt.Errorf with errors.New, enhancing clarity and consistency in error reporting.
  • Chores
    • Updated import statements to include the errors package where necessary for standardized error creation.

Copy link
Contributor

coderabbitai bot commented Jul 25, 2024

Walkthrough

Walkthrough

The recent changes across various files primarily focus on enhancing error handling by replacing formatted error messages created with fmt.Errorf with simpler, direct error instantiation using errors.New. This approach improves code clarity and maintainability while preserving the overall control flow and behavior of the functions involved. The modifications span multiple components, including services, commands, and tests within the codebase.

Changes

Files Change Summary
baseapp/grpcrouter_helpers.go, client/cmd.go, client/grpc_query.go, client/snapshot/load.go, client/tx/factory.go, client/tx/tx_test.go, client/v2/autocli/flag/coin.go, client/v2/internal/coins/format.go, client/v2/internal/prompt/validation.go, client/v2/offchain/verify.go, collections/iter_test.go, collections/map_test.go, depinject/appconfig/config.go, depinject/container_test.go, depinject/internal/codegen/file.go, indexer/postgres/indexer.go, internal/testutil/cmd_test.go, orm/encoding/ormfield/uint32.go, orm/encoding/ormfield/uint64.go, orm/internal/listinternal/options.go, orm/model/ormdb/module.go, orm/model/ormdb/module_test.go, orm/model/ormtable/backend.go, orm/model/ormtable/bench_test.go, runtime/branch_test.go, runtime/v2/manager.go, schema/decoding/decoding_test.go, server/cmt_cmds.go, server/grpc/reflection/v2alpha1/reflection.go, server/v2/api/telemetry/metrics.go, server/v2/appmanager/appmanager.go, server/v2/cometbft/abci.go, server/v2/cometbft/commands.go, server/v2/cometbft/handlers/defaults.go, server/v2/cometbft/utils.go, server/v2/stf/core_branch_service_test.go, server/v2/stf/stf_test.go, store/v2/commitment/store.go, store/v2/migration/manager.go, tests/integration/example/example_test.go, testutil/network/network.go, testutil/sims/address_helpers.go, testutil/sims/app_helpers.go, testutil/sims/state_helpers.go, testutil/testdata/grpc_query.go, tools/cosmovisor/args.go, tools/hubl/internal/version.go, types/collections.go, types/mempool/mempool_test.go, types/mempool/priority_nonce.go, types/mempool/sender_nonce.go, types/mempool/signer_extraction_adapater_test.go, types/query/collections_pagination.go, types/query/filtered_pagination.go, types/query/pagination.go, types/simulation/account.go Error handling updated from fmt.Errorf to errors.New for simpler error creation. No structural changes to function signatures.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yukionfire yukionfire changed the title all: replace all fmt.Errorf without paramters with errors.New chore(all): replace all fmt.Errorf without paramters with errors.New Jul 25, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6a2d039 and d804a6b.

Files selected for processing (57)
  • baseapp/grpcrouter_helpers.go (2 hunks)
  • client/cmd.go (1 hunks)
  • client/grpc_query.go (2 hunks)
  • client/snapshot/load.go (1 hunks)
  • client/tx/factory.go (1 hunks)
  • client/tx/tx_test.go (2 hunks)
  • client/v2/autocli/flag/coin.go (2 hunks)
  • client/v2/internal/coins/format.go (2 hunks)
  • client/v2/internal/prompt/validation.go (2 hunks)
  • client/v2/offchain/verify.go (1 hunks)
  • collections/iter_test.go (2 hunks)
  • collections/map_test.go (2 hunks)
  • depinject/appconfig/config.go (2 hunks)
  • depinject/container_test.go (3 hunks)
  • depinject/internal/codegen/file.go (2 hunks)
  • indexer/postgres/indexer.go (2 hunks)
  • internal/testutil/cmd_test.go (2 hunks)
  • orm/encoding/ormfield/uint32.go (2 hunks)
  • orm/encoding/ormfield/uint64.go (2 hunks)
  • orm/internal/listinternal/options.go (2 hunks)
  • orm/model/ormdb/module.go (3 hunks)
  • orm/model/ormdb/module_test.go (3 hunks)
  • orm/model/ormtable/backend.go (2 hunks)
  • orm/model/ormtable/bench_test.go (3 hunks)
  • runtime/branch_test.go (3 hunks)
  • runtime/v2/manager.go (1 hunks)
  • schema/decoding/decoding_test.go (2 hunks)
  • server/cmt_cmds.go (3 hunks)
  • server/grpc/reflection/v2alpha1/reflection.go (1 hunks)
  • server/v2/api/telemetry/metrics.go (3 hunks)
  • server/v2/appmanager/appmanager.go (2 hunks)
  • server/v2/cometbft/abci.go (2 hunks)
  • server/v2/cometbft/commands.go (3 hunks)
  • server/v2/cometbft/handlers/defaults.go (1 hunks)
  • server/v2/cometbft/utils.go (2 hunks)
  • server/v2/stf/core_branch_service_test.go (2 hunks)
  • server/v2/stf/stf_test.go (5 hunks)
  • store/v2/commitment/store.go (2 hunks)
  • store/v2/migration/manager.go (1 hunks)
  • tests/integration/example/example_test.go (3 hunks)
  • testutil/network/network.go (4 hunks)
  • testutil/sims/address_helpers.go (2 hunks)
  • testutil/sims/app_helpers.go (2 hunks)
  • testutil/sims/state_helpers.go (2 hunks)
  • testutil/testdata/grpc_query.go (2 hunks)
  • tools/cosmovisor/args.go (1 hunks)
  • tools/hubl/internal/version.go (2 hunks)
  • types/collections.go (2 hunks)
  • types/mempool/mempool_test.go (2 hunks)
  • types/mempool/priority_nonce.go (4 hunks)
  • types/mempool/sender_nonce.go (3 hunks)
  • types/mempool/signer_extraction_adapater_test.go (3 hunks)
  • types/query/collections_pagination.go (2 hunks)
  • types/query/filtered_pagination.go (3 hunks)
  • types/query/pagination.go (2 hunks)
  • types/simulation/account.go (2 hunks)
  • x/protocolpool/keeper/genesis.go (2 hunks)
Files skipped from review due to trivial changes (33)
  • baseapp/grpcrouter_helpers.go
  • client/grpc_query.go
  • client/tx/tx_test.go
  • client/v2/autocli/flag/coin.go
  • client/v2/internal/coins/format.go
  • client/v2/internal/prompt/validation.go
  • client/v2/offchain/verify.go
  • collections/map_test.go
  • orm/encoding/ormfield/uint32.go
  • orm/encoding/ormfield/uint64.go
  • orm/internal/listinternal/options.go
  • orm/model/ormdb/module.go
  • orm/model/ormdb/module_test.go
  • orm/model/ormtable/backend.go
  • orm/model/ormtable/bench_test.go
  • runtime/branch_test.go
  • runtime/v2/manager.go
  • server/v2/api/telemetry/metrics.go
  • server/v2/appmanager/appmanager.go
  • server/v2/cometbft/abci.go
  • server/v2/cometbft/commands.go
  • server/v2/cometbft/handlers/defaults.go
  • server/v2/stf/core_branch_service_test.go
  • store/v2/commitment/store.go
  • tests/integration/example/example_test.go
  • testutil/network/network.go
  • types/collections.go
  • types/mempool/sender_nonce.go
  • types/mempool/signer_extraction_adapater_test.go
  • types/query/collections_pagination.go
  • types/query/pagination.go
  • types/simulation/account.go
  • x/protocolpool/keeper/genesis.go
Additional context used
Path-based instructions (24)
tools/hubl/internal/version.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

indexer/postgres/indexer.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/internal/codegen/file.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

testutil/testdata/grpc_query.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

client/snapshot/load.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

testutil/sims/address_helpers.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

collections/iter_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"

depinject/appconfig/config.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

types/query/filtered_pagination.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

internal/testutil/cmd_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"

server/grpc/reflection/v2alpha1/reflection.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

store/v2/migration/manager.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

types/mempool/mempool_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"

server/v2/stf/stf_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"

testutil/sims/state_helpers.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

testutil/sims/app_helpers.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

schema/decoding/decoding_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"

server/cmt_cmds.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

server/v2/cometbft/utils.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

client/cmd.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

types/mempool/priority_nonce.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

depinject/container_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"

client/tx/factory.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

tools/cosmovisor/args.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (37)
tools/hubl/internal/version.go (1)

4-4: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies the error creation process and improves readability.

Also applies to: 22-22

indexer/postgres/indexer.go (1)

6-6: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies the error creation process and improves readability.

Also applies to: 27-27

depinject/internal/codegen/file.go (1)

4-4: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies the error creation process and improves readability.

Also applies to: 64-64

testutil/testdata/grpc_query.go (1)

31-31: LGTM! Simplified error creation with errors.New.

The change from fmt.Errorf to errors.New is appropriate here as no formatting is required.

client/snapshot/load.go (2)

105-105: LGTM! Simplified error creation with errors.New.

The change from fmt.Errorf to errors.New is appropriate here as no formatting is required.


110-110: LGTM! Simplified error creation with errors.New.

The change from fmt.Errorf to errors.New is appropriate here as no formatting is required.

testutil/sims/address_helpers.go (1)

111-111: LGTM! Simplified error creation with errors.New.

The change from fmt.Errorf to errors.New is appropriate here as no formatting is required.

collections/iter_test.go (2)

4-4: LGTM!

The addition of the errors package is appropriate for the changes made.


192-192: LGTM!

The use of errors.New for creating a simple error message is more idiomatic and improves readability.

depinject/appconfig/config.go (2)

4-4: LGTM!

The addition of the errors package is appropriate for the changes made.


99-99: LGTM!

The use of errors.New for creating a simple error message is more idiomatic and improves readability.

types/query/filtered_pagination.go (3)

4-4: LGTM!

The addition of the errors package is appropriate for the changes made.


29-29: LGTM!

The use of errors.New for creating a simple error message is more idiomatic and improves readability.


154-154: LGTM!

The use of errors.New for creating a simple error message is more idiomatic and improves readability.

internal/testutil/cmd_test.go (1)

25-25: LGTM!

The change from fmt.Errorf to errors.New simplifies the error creation process and aligns with the PR objective. The error message remains clear.

server/grpc/reflection/v2alpha1/reflection.go (1)

165-165: LGTM!

The change from fmt.Errorf to errors.New simplifies the error creation process and aligns with the PR objective. The error message remains clear.

store/v2/migration/manager.go (1)

218-218: LGTM!

The change from fmt.Errorf to errors.New simplifies the error creation process and aligns with the PR objective. The error message remains clear.

types/mempool/mempool_test.go (1)

221-221: LGTM! Simplified error creation.

The change from fmt.Errorf("error") to errors.New("error") simplifies the error creation process and aligns with the PR objective.

server/v2/stf/stf_test.go (5)

161-161: LGTM! Simplified error creation.

The change from fmt.Errorf("failure") to errors.New("failure") simplifies the error creation process and aligns with the PR objective.


183-183: LGTM! Simplified error creation.

The change from fmt.Errorf("post tx failure") to errors.New("post tx failure") simplifies the error creation process and aligns with the PR objective.


204-204: LGTM! Simplified error creation.

The change from fmt.Errorf("exec failure") to errors.New("exec failure") simplifies the error creation process and aligns with the PR objective.


206-206: LGTM! Simplified error creation.

The change from fmt.Errorf("post tx failure") to errors.New("post tx failure") simplifies the error creation process and aligns with the PR objective.


226-226: LGTM! Simplified error creation.

The change from fmt.Errorf("failure") to errors.New("failure") simplifies the error creation process and aligns with the PR objective.

testutil/sims/state_helpers.go (1)

292-292: LGTM! Simplified error creation.

The change from fmt.Errorf("expected account") to errors.New("expected account") simplifies the error creation process and aligns with the PR objective.

testutil/sims/app_helpers.go (1)

168-168: LGTM! The error handling change simplifies error creation.

Replacing fmt.Errorf with errors.New enhances readability and maintains the existing functionality.

schema/decoding/decoding_test.go (1)

364-364: LGTM! The error handling change simplifies error creation.

Replacing fmt.Errorf with errors.New enhances readability and maintains the existing functionality.

server/cmt_cmds.go (2)

243-243: LGTM! The error handling change simplifies error creation.

Replacing fmt.Errorf with errors.New enhances readability and maintains the existing functionality.


269-269: LGTM! The error handling change simplifies error creation.

Replacing fmt.Errorf with errors.New enhances readability and maintains the existing functionality.

server/v2/cometbft/utils.go (1)

300-300: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation and aligns with Go's idiomatic practices.

client/cmd.go (1)

293-293: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation and aligns with Go's idiomatic practices.

types/mempool/priority_nonce.go (3)

219-219: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation and aligns with Go's idiomatic practices.


440-440: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation and aligns with Go's idiomatic practices.


470-470: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation and aligns with Go's idiomatic practices.

depinject/container_test.go (2)

304-305: LGTM!

The change to use errors.New instead of fmt.Errorf is correct and aligns with the PR objective of standardizing error handling.


610-611: LGTM!

The change to use errors.New instead of fmt.Errorf is correct and aligns with the PR objective of standardizing error handling.

client/tx/factory.go (1)

444-445: LGTM!

The change to use errors.New instead of fmt.Errorf is correct and aligns with the PR objective of standardizing error handling.

tools/cosmovisor/args.go (1)

313-314: LGTM!

The change to use errors.New instead of fmt.Errorf is correct and aligns with the PR objective of standardizing error handling.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6a2d039 and d804a6b.

Files selected for processing (56)
  • baseapp/grpcrouter_helpers.go (2 hunks)
  • client/cmd.go (1 hunks)
  • client/grpc_query.go (2 hunks)
  • client/snapshot/load.go (1 hunks)
  • client/tx/factory.go (1 hunks)
  • client/tx/tx_test.go (2 hunks)
  • client/v2/autocli/flag/coin.go (2 hunks)
  • client/v2/internal/coins/format.go (2 hunks)
  • client/v2/internal/prompt/validation.go (2 hunks)
  • client/v2/offchain/verify.go (1 hunks)
  • collections/iter_test.go (2 hunks)
  • collections/map_test.go (2 hunks)
  • depinject/appconfig/config.go (2 hunks)
  • depinject/container_test.go (3 hunks)
  • depinject/internal/codegen/file.go (2 hunks)
  • indexer/postgres/indexer.go (2 hunks)
  • internal/testutil/cmd_test.go (2 hunks)
  • orm/encoding/ormfield/uint32.go (2 hunks)
  • orm/encoding/ormfield/uint64.go (2 hunks)
  • orm/internal/listinternal/options.go (2 hunks)
  • orm/model/ormdb/module.go (3 hunks)
  • orm/model/ormdb/module_test.go (3 hunks)
  • orm/model/ormtable/backend.go (2 hunks)
  • orm/model/ormtable/bench_test.go (3 hunks)
  • runtime/branch_test.go (3 hunks)
  • runtime/v2/manager.go (1 hunks)
  • schema/decoding/decoding_test.go (2 hunks)
  • server/cmt_cmds.go (3 hunks)
  • server/grpc/reflection/v2alpha1/reflection.go (1 hunks)
  • server/v2/api/telemetry/metrics.go (3 hunks)
  • server/v2/appmanager/appmanager.go (2 hunks)
  • server/v2/cometbft/abci.go (2 hunks)
  • server/v2/cometbft/commands.go (3 hunks)
  • server/v2/cometbft/handlers/defaults.go (1 hunks)
  • server/v2/cometbft/utils.go (2 hunks)
  • server/v2/stf/core_branch_service_test.go (2 hunks)
  • server/v2/stf/stf_test.go (5 hunks)
  • store/v2/commitment/store.go (2 hunks)
  • store/v2/migration/manager.go (1 hunks)
  • tests/integration/example/example_test.go (3 hunks)
  • testutil/network/network.go (4 hunks)
  • testutil/sims/address_helpers.go (2 hunks)
  • testutil/sims/app_helpers.go (2 hunks)
  • testutil/sims/state_helpers.go (2 hunks)
  • testutil/testdata/grpc_query.go (2 hunks)
  • tools/cosmovisor/args.go (1 hunks)
  • tools/hubl/internal/version.go (2 hunks)
  • types/collections.go (2 hunks)
  • types/mempool/mempool_test.go (2 hunks)
  • types/mempool/priority_nonce.go (4 hunks)
  • types/mempool/sender_nonce.go (3 hunks)
  • types/mempool/signer_extraction_adapater_test.go (3 hunks)
  • types/query/collections_pagination.go (2 hunks)
  • types/query/filtered_pagination.go (3 hunks)
  • types/query/pagination.go (2 hunks)
  • types/simulation/account.go (2 hunks)
Files not processed due to max files limit (1)
  • x/protocolpool/keeper/genesis.go
Files skipped from review due to trivial changes (37)
  • baseapp/grpcrouter_helpers.go
  • client/cmd.go
  • client/grpc_query.go
  • client/snapshot/load.go
  • client/tx/factory.go
  • client/v2/internal/coins/format.go
  • client/v2/internal/prompt/validation.go
  • collections/iter_test.go
  • depinject/appconfig/config.go
  • depinject/internal/codegen/file.go
  • indexer/postgres/indexer.go
  • orm/encoding/ormfield/uint32.go
  • orm/encoding/ormfield/uint64.go
  • orm/internal/listinternal/options.go
  • orm/model/ormtable/backend.go
  • orm/model/ormtable/bench_test.go
  • runtime/v2/manager.go
  • schema/decoding/decoding_test.go
  • server/grpc/reflection/v2alpha1/reflection.go
  • server/v2/api/telemetry/metrics.go
  • server/v2/appmanager/appmanager.go
  • server/v2/cometbft/abci.go
  • server/v2/cometbft/commands.go
  • server/v2/cometbft/handlers/defaults.go
  • server/v2/cometbft/utils.go
  • store/v2/commitment/store.go
  • store/v2/migration/manager.go
  • tests/integration/example/example_test.go
  • testutil/sims/state_helpers.go
  • tools/cosmovisor/args.go
  • types/collections.go
  • types/mempool/mempool_test.go
  • types/mempool/priority_nonce.go
  • types/mempool/sender_nonce.go
  • types/query/collections_pagination.go
  • types/query/filtered_pagination.go
  • types/simulation/account.go
Additional context used
Path-based instructions (19)
tools/hubl/internal/version.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

client/v2/autocli/flag/coin.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

types/mempool/signer_extraction_adapater_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"

server/v2/stf/core_branch_service_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"

testutil/testdata/grpc_query.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

client/v2/offchain/verify.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

runtime/branch_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"

collections/map_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"

types/query/pagination.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

testutil/sims/address_helpers.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

internal/testutil/cmd_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"

orm/model/ormdb/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

server/v2/stf/stf_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"

testutil/sims/app_helpers.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

server/cmt_cmds.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

orm/model/ormdb/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"

client/tx/tx_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"

depinject/container_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"

testutil/network/network.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (42)
tools/hubl/internal/version.go (2)

4-4: Import statement update.

The import statement for errors is correctly added to support the new error handling approach.


22-22: Error handling update.

The use of errors.New here is appropriate as the error message does not require any formatting.

client/v2/autocli/flag/coin.go (2)

5-5: Import statement update.

The import statement for errors is correctly added to support the new error handling approach.


41-41: Error handling update.

The use of errors.New here is appropriate as the error message does not require any formatting.

types/mempool/signer_extraction_adapater_test.go (3)

4-4: Import statement update.

The import statement for errors is correctly added to support the new error handling approach. The fmt import is retained for other uses.


56-56: Error handling update.

The use of errors.New here is appropriate as the error message does not require any formatting.


67-67: Error handling update.

The use of errors.New here is appropriate as the error message does not require any formatting.

server/v2/stf/core_branch_service_test.go (2)

5-5: Import errors is appropriate.

The import of the errors package is necessary for the changes made.


73-73: LGTM!

The change from fmt.Errorf to errors.New is appropriate here as no formatting is required.

testutil/testdata/grpc_query.go (2)

5-5: Import errors is appropriate.

The import of the errors package is necessary for the changes made.


31-31: LGTM!

The change from fmt.Errorf to errors.New is appropriate here as no formatting is required.

client/v2/offchain/verify.go (1)

126-126: LGTM!

The change from fmt.Errorf to errors.New is appropriate here as no formatting is required.

runtime/branch_test.go (3)

5-5: Conformity with Uber Go Style Guide

The import of the errors package aligns with the Uber Go Style Guide, which recommends using errors.New for static error messages.


55-55: Simplified error creation

The use of errors.New simplifies error creation and enhances code readability.


79-79: Consistent error handling

The replacement of fmt.Errorf with errors.New ensures consistent error handling throughout the codebase.

collections/map_test.go (2)

5-5: Conformity with Uber Go Style Guide

The import of the errors package aligns with the Uber Go Style Guide, which recommends using errors.New for static error messages.


56-56: Simplified error creation

The use of errors.New simplifies error creation and enhances code readability.

types/query/pagination.go (2)

4-4: Conformity with Uber Go Style Guide

The import of the errors package aligns with the Uber Go Style Guide, which recommends using errors.New for static error messages.


65-65: Simplified error creation

The use of errors.New simplifies error creation and enhances code readability.

testutil/sims/address_helpers.go (2)

6-6: LGTM! Import change is appropriate.

The import change from fmt to errors aligns with the updated error handling approach.


111-111: LGTM! Simplified error handling.

The change from fmt.Errorf to errors.New is appropriate as no formatting is required.

internal/testutil/cmd_test.go (2)

4-4: LGTM! Import change is appropriate.

The import change from fmt to errors aligns with the updated error handling approach.


25-25: LGTM! Simplified error handling.

The change from fmt.Errorf to errors.New is appropriate as no formatting is required.

orm/model/ormdb/module.go (3)

7-7: LGTM! Import change is appropriate.

The import change from fmt to errors aligns with the updated error handling approach.


115-115: LGTM! Simplified error handling.

The change from fmt.Errorf to errors.New is appropriate as no formatting is required.


128-128: LGTM! Simplified error handling.

The change from fmt.Errorf to errors.New is appropriate as no formatting is required.

server/v2/stf/stf_test.go (4)

161-161: LGTM! The change to errors.New is appropriate.

The change from fmt.Errorf to errors.New is correct since no formatting is required.


183-183: LGTM! The change to errors.New is appropriate.

The change from fmt.Errorf to errors.New is correct since no formatting is required.


204-206: LGTM! The changes to errors.New are appropriate.

The change from fmt.Errorf to errors.New is correct since no formatting is required.


226-226: LGTM! The change to errors.New is appropriate.

The change from fmt.Errorf to errors.New is correct since no formatting is required.

testutil/sims/app_helpers.go (1)

168-168: LGTM! The change to errors.New is appropriate.

The change from fmt.Errorf to errors.New is correct since no formatting is required.

server/cmt_cmds.go (2)

243-243: LGTM! The change to errors.New is appropriate.

The change from fmt.Errorf to errors.New is correct since no formatting is required.


269-269: LGTM! The change to errors.New is appropriate.

The change from fmt.Errorf to errors.New is correct since no formatting is required.

orm/model/ormdb/module_test.go (2)

106-106: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New for the "insufficient supply" error message simplifies the error creation process and aligns with Go best practices.


174-174: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New for the "insufficient funds" error message simplifies the error creation process and aligns with Go best practices.

client/tx/tx_test.go (1)

48-48: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New for the "mock err" error message simplifies the error creation process and aligns with Go best practices.

depinject/container_test.go (2)

304-304: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New for the error message simplifies the error creation process and aligns with Go best practices.


610-610: LGTM! Simplified error creation.

The change from fmt.Errorf to errors.New for the error message simplifies the error creation process and aligns with Go best practices.

testutil/network/network.go (4)

353-353: Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation as no formatting is required.


370-370: Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation as no formatting is required.


380-380: Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation as no formatting is required.


413-413: Simplified error creation.

The change from fmt.Errorf to errors.New simplifies error creation as no formatting is required.

@tac0turtle tac0turtle merged commit d6ad92d into cosmos:main Jul 25, 2024
68 of 71 checks passed
alpe added a commit that referenced this pull request Jul 26, 2024
* main:
  feat(log): remove core dependency and update core interface to be dependency free (#21045)
  chore: fix some comments (#21085)
  feat: simulate nested messages (#20291)
  chore(network): remove `DefaultConfigWithAppConfigWithQueryGasLimit` (#21055)
  fix(runtime): remove `appv1alpha1.Config` from runtime (#21042)
  feat(simapp/v2): Add store server to testnet init cmd (#21076)
  chore(indexer/postgres): update to changes on main (#21077)
  feat(schema/appdata): async listener mux'ing (#20879)
  ci: Use large box for 052 branch sims on CI (#21067)
  chore(all): replace all `fmt.Errorf` without paramters with `errors.New` (#21068)
@yukionfire yukionfire deleted the chore/error-fmt-clean branch July 26, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants