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: fix all lint issue since golangci-lint bump #21326

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Aug 16, 2024

Description

With the bump to golangci-lint v1.60.1, some lint issue have happened: which blocks other PR with unrelated required changes: https://github.com/cosmos/cosmos-sdk/actions/runs/10418897604/job/28855908251?pr=21281

We had a job to run golangci-lint in the whole codebase at version bump, but due to the split of the makefile this hasn't happened.

This PR fixes all errors returned by make lint-fix and updates the job to re-run linting on the whole codebase if a *.mk file it touched.


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...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features
    • Enhanced linting process to include .mk files for better validation of Makefiles.
  • Bug Fixes
    • Improved error handling in various components, ensuring clearer error messaging and consistency across logging and context management.
  • Documentation
    • Updated CHANGELOG to include reference to fixes addressing context key collisions and enhance project documentation clarity.
  • Chores
    • Streamlined error reporting by simplifying error wrapping methods across multiple files.

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Aug 16, 2024
@julienrbrt julienrbrt requested a review from a team as a code owner August 16, 2024 11:28
Copy link
Contributor

coderabbitai bot commented Aug 16, 2024

Warning

Rate limit exceeded

@julienrbrt has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 36 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between aeeaca6 and ea2a542.

Walkthrough

Walkthrough

The recent changes primarily focus on enhancing error handling and type safety in various components of the codebase. This includes modifications to error reporting methods, the introduction of new types for context keys, and updates to the linting process to include Makefiles. These adjustments aim to improve code clarity, maintainability, and overall functionality without altering existing logic significantly.

Changes

Files & Directories Change Summary
.github/workflows/lint.yml Added **/*.mk pattern to lint Makefiles, enhancing the scope of the linter.
client/v2/autocli/keyring/keyring.go Changed KeyringContextKey from an empty struct to a new type keyringContextKey, improving type safety.
log/CHANGELOG.md Added a new changelog entry for version v1.4.1, referencing PR #21326 related to context key collisions.
log/logger.go Modified ContextKey type from an empty struct to contextKey, enhancing type safety.
simapp/simd/cmd/root_di.go Reorganized the import statement for nodeservice, improving clarity.
tests/integration/slashing/slashing_test.go Corrected error assertion in TestSlashingMsgs to accurately check for types.ErrValidatorNotJailed.
tests/systemtests/system.go Changed error reporting method from t.Fatalf to t.Fatal, simplifying the error handling.
tools/cosmovisor/cmd/cosmovisor/version_test.go Added a comment to suppress a static analysis issue related to a dependency.
x/auth/keeper/grpc_query.go Updated error handling from status.Errorf to status.Error, simplifying error messages across multiple methods.
x/authz/keeper/grpc_query.go Replaced status.Errorf with status.Error in several methods for consistent error handling.
x/distribution/keeper/grpc_query.go Changed error wrapping from errors.Wrapf to errors.Wrap in ValidatorOutstandingRewards and ValidatorCommission.
x/distribution/keeper/msg_server.go Simplified error wrapping in DepositValidatorRewardsPool by using errors.Wrap instead of errors.Wrapf.
x/evidence/keeper/grpc_query.go Modified error handling in the Evidence function from status.Errorf to status.Error.
x/feegrant/keeper/grpc_query.go Changed error handling in Allowance from status.Errorf to status.Error.
x/gov/keeper/msg_server.go Simplified error wrapping in SudoExec from errors.Wrapf to errors.Wrap.
x/gov/keeper/proposal.go Updated error handling in SubmitProposal from errorsmod.Wrapf to errorsmod.Wrap.
x/group/client/cli/tx.go Removed check for prop.Proposers being nil, simplifying logic to check only for its length.
x/group/keeper/keeper.go Changed error wrapping in assertMetadataLength from Wrapf to Wrap.
x/slashing/keeper/signing_info.go Simplified error message construction in JailUntil by removing fmt.Sprintf.
x/upgrade/keeper/abci_test.go Modified error assertion order in TestRequireFutureBlock and TestCantApplySameUpgradeTwice for clarity when using errors.Is.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant System
    participant Logger
    participant Keyring

    User->>System: Trigger action
    System->>Keyring: Retrieve keyring context
    Keyring-->>System: Return keyring context
    System->>Logger: Log event
    Logger-->>System: Confirm log
    System-->>User: Response
Loading

This diagram illustrates the primary interactions between the user, system, logger, and keyring components during an action. The flow remains intact while showcasing the enhanced clarity in error handling and context management introduced in the recent changes.


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.

@github-actions github-actions bot added C:Cosmovisor Issues and PR related to Cosmovisor C:log labels Aug 16, 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 aeeaca6 and e15a9b5.

Files selected for processing (20)
  • .github/workflows/lint.yml (1 hunks)
  • client/v2/autocli/keyring/keyring.go (1 hunks)
  • log/CHANGELOG.md (1 hunks)
  • log/logger.go (1 hunks)
  • simapp/simd/cmd/root_di.go (1 hunks)
  • tests/integration/slashing/slashing_test.go (1 hunks)
  • tests/systemtests/system.go (1 hunks)
  • tools/cosmovisor/cmd/cosmovisor/version_test.go (1 hunks)
  • x/auth/keeper/grpc_query.go (4 hunks)
  • x/authz/keeper/grpc_query.go (4 hunks)
  • x/distribution/keeper/grpc_query.go (2 hunks)
  • x/distribution/keeper/msg_server.go (1 hunks)
  • x/evidence/keeper/grpc_query.go (1 hunks)
  • x/feegrant/keeper/grpc_query.go (2 hunks)
  • x/gov/keeper/msg_server.go (1 hunks)
  • x/gov/keeper/proposal.go (1 hunks)
  • x/group/client/cli/tx.go (1 hunks)
  • x/group/keeper/keeper.go (1 hunks)
  • x/slashing/keeper/signing_info.go (1 hunks)
  • x/upgrade/keeper/abci_test.go (2 hunks)
Files skipped from review due to trivial changes (8)
  • .github/workflows/lint.yml
  • log/CHANGELOG.md
  • simapp/simd/cmd/root_di.go
  • tools/cosmovisor/cmd/cosmovisor/version_test.go
  • x/auth/keeper/grpc_query.go
  • x/distribution/keeper/grpc_query.go
  • x/gov/keeper/msg_server.go
  • x/slashing/keeper/signing_info.go
Additional context used
Path-based instructions (12)
client/v2/autocli/keyring/keyring.go (1)

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

x/evidence/keeper/grpc_query.go (1)

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

x/feegrant/keeper/grpc_query.go (1)

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

tests/integration/slashing/slashing_test.go (3)

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


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/authz/keeper/grpc_query.go (1)

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

log/logger.go (1)

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

x/distribution/keeper/msg_server.go (1)

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

x/gov/keeper/proposal.go (1)

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

x/group/client/cli/tx.go (1)

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

x/group/keeper/keeper.go (1)

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

x/upgrade/keeper/abci_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"

tests/systemtests/system.go (2)

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


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

Additional comments not posted (13)
client/v2/autocli/keyring/keyring.go (1)

13-15: Enhanced Type Safety with keyringContextKey.

The introduction of keyringContextKey improves type safety by using a specific type for context keys, reducing the risk of key collisions. This is a good practice for context usage in Go.

x/evidence/keeper/grpc_query.go (1)

56-56: Simplified Error Handling.

The change from status.Errorf to status.Error simplifies error handling by removing unnecessary formatting, enhancing readability without affecting functionality.

x/feegrant/keeper/grpc_query.go (1)

38-38: Simplified Error Handling.

The change from status.Errorf to status.Error simplifies error handling by removing unnecessary formatting, enhancing readability without affecting functionality.

Also applies to: 48-48

tests/integration/slashing/slashing_test.go (1)

117-117: Correct usage of errors.Is.

The change in the parameter order of errors.Is aligns with its intended usage, enhancing error handling accuracy.

x/authz/keeper/grpc_query.go (1)

51-51: Simplified error handling with status.Error.

Switching from status.Errorf to status.Error simplifies error handling by eliminating unnecessary formatting, which is appropriate here.

Also applies to: 73-73, 114-114, 169-169

log/logger.go (1)

33-35: Enhanced type safety with contextKey.

Introducing a distinct contextKey type for ContextKey improves type safety and helps prevent key collisions in context usage.

x/distribution/keeper/msg_server.go (1)

192-192: Consider using Wrapf for more informative error messages.

The change from errors.Wrapf to errors.Wrap simplifies the error message but removes the ability to include the validator address in the error context. Consider whether this context is necessary for debugging or logging purposes.

Verification successful

Consider Using Wrapf for Dynamic Error Messages

The current use of errors.Wrap is consistent across the codebase, but switching to errors.Wrapf could enhance error messages by including dynamic data like the validator address, which can aid in debugging and logging.

  • File: x/distribution/keeper/msg_server.go
  • Line: 192
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `errors.Wrap` is used consistently for error wrapping in the codebase.

# Test: Search for `errors.Wrap` usage. Expect: Consistent usage across the codebase.
rg --type go 'errors\.Wrap\('

Length of output: 10934

x/gov/keeper/proposal.go (1)

86-88: Consider using Wrapf for more informative error messages.

The change from errorsmod.Wrapf to errorsmod.Wrap simplifies the error message but removes the ability to include the signer address in the error context. Consider whether this context is necessary for debugging or logging purposes.

x/group/client/cli/tx.go (1)

501-501: Ensure prop.Proposers is always initialized.

The simplification assumes prop.Proposers is never nil. Ensure that this assumption holds throughout the codebase to prevent potential nil pointer dereference errors.

x/group/keeper/keeper.go (1)

458-458: Consider the implications of using Wrap instead of Wrapf.

The change from Wrapf to Wrap in the assertMetadataLength function simplifies error handling by removing formatting capabilities. Ensure that this change does not reduce the context needed for debugging. If additional context is required, consider using Wrapf with a formatted message.

x/upgrade/keeper/abci_test.go (2)

151-151: Correct use of errors.Is function.

The change in argument order for errors.Is correctly aligns with its intended use, enhancing the clarity and accuracy of error checking.


226-226: Correct use of errors.Is function.

The change in argument order for errors.Is correctly aligns with its intended use, enhancing the clarity and accuracy of error checking.

tests/systemtests/system.go (1)

250-250: Use of t.Fatal instead of t.Fatalf.

The change from t.Fatalf to t.Fatal in the AwaitUpgradeInfo method allows deferred functions to execute after a test failure. Ensure that this behavior aligns with the intended test cleanup process.

Verification successful

No impact on test cleanup from changing t.Fatalf to t.Fatal.

The change from t.Fatalf to t.Fatal in the AwaitUpgradeInfo method does not affect test cleanup in its current usage context, as there are no deferred functions in the relevant test file. Thus, the behavior aligns with the intended test process.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `AwaitUpgradeInfo` is invoked in tests and if the change from `t.Fatalf` to `t.Fatal` impacts test cleanup.

# Test: Search for the function usage. Expect: Occurrences where the function is invoked.
rg --type go -A 5 $'AwaitUpgradeInfo'

Length of output: 926


Script:

#!/bin/bash
# Check for deferred functions in the `upgrade_test.go` file where `AwaitUpgradeInfo` is used.
rg --type go 'defer' tests/systemtests/upgrade_test.go

Length of output: 54

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 aeeaca6 and e15a9b5.

Files selected for processing (20)
  • .github/workflows/lint.yml (1 hunks)
  • client/v2/autocli/keyring/keyring.go (1 hunks)
  • log/CHANGELOG.md (1 hunks)
  • log/logger.go (1 hunks)
  • simapp/simd/cmd/root_di.go (1 hunks)
  • tests/integration/slashing/slashing_test.go (1 hunks)
  • tests/systemtests/system.go (1 hunks)
  • tools/cosmovisor/cmd/cosmovisor/version_test.go (1 hunks)
  • x/auth/keeper/grpc_query.go (4 hunks)
  • x/authz/keeper/grpc_query.go (4 hunks)
  • x/distribution/keeper/grpc_query.go (2 hunks)
  • x/distribution/keeper/msg_server.go (1 hunks)
  • x/evidence/keeper/grpc_query.go (1 hunks)
  • x/feegrant/keeper/grpc_query.go (2 hunks)
  • x/gov/keeper/msg_server.go (1 hunks)
  • x/gov/keeper/proposal.go (1 hunks)
  • x/group/client/cli/tx.go (1 hunks)
  • x/group/keeper/keeper.go (1 hunks)
  • x/slashing/keeper/signing_info.go (1 hunks)
  • x/upgrade/keeper/abci_test.go (2 hunks)
Files skipped from review due to trivial changes (7)
  • log/CHANGELOG.md
  • simapp/simd/cmd/root_di.go
  • tools/cosmovisor/cmd/cosmovisor/version_test.go
  • x/auth/keeper/grpc_query.go
  • x/authz/keeper/grpc_query.go
  • x/distribution/keeper/grpc_query.go
  • x/slashing/keeper/signing_info.go
Additional context used
Path-based instructions (12)
client/v2/autocli/keyring/keyring.go (1)

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

x/evidence/keeper/grpc_query.go (1)

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

x/feegrant/keeper/grpc_query.go (1)

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

tests/integration/slashing/slashing_test.go (3)

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


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

log/logger.go (1)

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

x/distribution/keeper/msg_server.go (1)

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

x/gov/keeper/proposal.go (1)

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

x/group/client/cli/tx.go (1)

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

x/group/keeper/keeper.go (1)

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

x/gov/keeper/msg_server.go (1)

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

x/upgrade/keeper/abci_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"

tests/systemtests/system.go (2)

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


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

Additional comments not posted (14)
client/v2/autocli/keyring/keyring.go (1)

13-15: Improved type safety with keyringContextKey.

The change from an empty struct to a distinct type enhances type safety and clarity in the code. This is a good practice to avoid potential key collisions in the context.

Ensure that all usages of KeyringContextKey in the codebase are updated to accommodate this change.

Verification successful

All usages of KeyringContextKey are consistent with the new type definition.

The codebase correctly uses KeyringContextKey as a context key with the new type keyringContextKey, ensuring improved type safety and avoiding potential key collisions.

  • client/v2/autocli/keyring/keyring.go: Used in context.WithValue.
  • client/v2/autocli/flag/address.go: Retrieved using dctx.Value.

No further changes are needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `KeyringContextKey` in the codebase.

# Test: Search for the usage of `KeyringContextKey`. Expect: Consistent usage with the new type.
rg --type go -A 5 $'KeyringContextKey'

Length of output: 1284

.github/workflows/lint.yml (1)

27-27: Expanded linting coverage to include .mk files.

Adding **/*.mk to the linting patterns ensures that all Makefile-related files are checked, improving consistency and maintainability.

x/evidence/keeper/grpc_query.go (1)

56-56: Simplified error handling with status.Error.

Using status.Error instead of status.Errorf removes unnecessary formatting, which simplifies the code and can enhance performance.

x/feegrant/keeper/grpc_query.go (1)

38-38: Consistent error handling with status.Error.

The change from status.Errorf to status.Error improves consistency in error handling. This is a good practice as it simplifies error message formatting.

Also applies to: 48-48

tests/integration/slashing/slashing_test.go (1)

117-117: Improved error assertion logic.

The correction in the error assertion logic enhances readability and correctness, aligning with Go's best practices for error handling.

log/logger.go (1)

33-35: Enhanced type safety with contextKey.

The introduction of contextKey as a distinct type for ContextKey improves type safety and maintainability by preventing potential type collisions.

x/distribution/keeper/msg_server.go (1)

192-192: Simplified error wrapping is acceptable.

The change from errors.Wrapf to errors.Wrap simplifies the error message. Ensure that the error message remains clear and informative without the formatted context.

x/gov/keeper/proposal.go (1)

86-88: Simplified error wrapping is acceptable.

The change from errorsmod.Wrapf to errorsmod.Wrap simplifies the error message. Ensure that the error message remains clear and informative without the formatted context.

x/group/client/cli/tx.go (1)

501-501: Verify assumption about prop.Proposers.

The removal of the nil check assumes that prop.Proposers will not be nil. Ensure this assumption is valid to prevent potential runtime errors.

x/group/keeper/keeper.go (1)

458-458: Simplify error wrapping by removing formatting.

The change from Wrapf to Wrap simplifies the error message handling by removing unnecessary formatting. This enhances consistency and clarity in error reporting.

x/gov/keeper/msg_server.go (1)

386-386: Simplify error wrapping by removing formatting.

The change from Wrapf to Wrap in the SudoExec function simplifies error handling by removing unnecessary formatting. This improves the consistency and clarity of error messages.

x/upgrade/keeper/abci_test.go (2)

151-151: Enhance readability in error checking.

Reversing the order of parameters in errors.Is improves readability and aligns with typical usage patterns, ensuring that the error variable is the first argument.


226-226: Enhance readability in error checking.

Reversing the order of parameters in errors.Is improves readability and aligns with typical usage patterns, ensuring that the error variable is the first argument.

tests/systemtests/system.go (1)

250-250: Simplified error handling is appropriate.

The change from t.Fatalf(err.Error()) to t.Fatal(err.Error()) simplifies the error handling without affecting functionality, as no formatting is required.

@julienrbrt julienrbrt added this pull request to the merge queue Aug 16, 2024
Merged via the queue into main with commit 6276b01 Aug 16, 2024
84 of 85 checks passed
@julienrbrt julienrbrt deleted the julien/make-lint-fix branch August 16, 2024 13:08
mergify bot pushed a commit that referenced this pull request Aug 16, 2024
(cherry picked from commit 6276b01)

# Conflicts:
#	log/CHANGELOG.md
#	log/logger.go
#	tools/cosmovisor/cmd/cosmovisor/version_test.go
julienrbrt added a commit that referenced this pull request Aug 16, 2024
alpe added a commit that referenced this pull request Aug 19, 2024
* main: (76 commits)
  docs: more app v2 renaming (#21336)
  chore: update link in disclaimer (#21339)
  refactor(x/distribution): audit QA (#21316)
  docs: rename app v2 to app di when talking about runtime v0 (#21329)
  feat(schema): specify JSON mapping (#21243)
  fix(x/authz): bring back msg response in `DispatchActions` (#21044)
  chore: fix all lint issue since golangci-lint bump (#21326)
  refactor(x/mint): v0.52 audit x/mint (#21301)
  chore: fix spelling errors (#21327)
  feat: export genesis in simapp v2 (#21199)
  fix(baseapp)!: Halt at height now does not produce the halt height block (#21256)
  refactor(scripts): remove unused variable (#21320)
  chore(schema/testing): upgrade to go 1.23 iterators (#21282)
  chore: readmes + upgrading docs (#21271)
  feat(client): add auto cli for node service (#21074)
  ci: fix github workflow vulnerable to script injection (#21304)
  build(deps): Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0 (#21307)
  build(deps): use Go 1.23 instead of Go 1.22 (#21280)
  refactor(x/auth): audit x/auth changes (#21146)
  chore: remove todo: "abstract out staking message back to staking" (#21266)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants