-
Notifications
You must be signed in to change notification settings - Fork 351
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
refactor: enable go-critic #3000
Conversation
WalkthroughWalkthroughThe changes across the codebase are primarily focused on adopting shorthand assignment operators to enhance code readability and maintainability. The files affected include various 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! It looks like golangci-lint is complaining still so I think a few more changes need to be made before we can merge this.
We're in a transitory phase where we're extracting a few of the files touched in this PR to https://github.com/celestiaorg/go-square. So if we enable go-critic here then we should also enable go-critic in that repo. Eventually the files in this repo that were moved to go-square will be removed.
Created: celestiaorg/go-square#18
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.
LGTM! Thanks for the contribution @moldis
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.
Thanks, Looks good to me too!
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.
thank you!
func SignalThreshold(_ uint64) Fraction { | ||
return defaultSignalTheshold |
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.
Tip
Codebase Verification
The change to the SignalThreshold
function in x/upgrade/keeper.go
to always return defaultSignalThreshold
and ignore the version parameter could affect the upgrade logic, as the GetVotingPowerThreshold
function relies on it to calculate the voting power threshold for upgrades. This threshold previously could vary with the app version, which is no longer the case after the change.
Analysis chain
The SignalThreshold
function has been simplified to always return defaultSignalTheshold
. This change removes the parameter and the switch statement, which is consistent with the summary. However, it's important to ensure that this change does not affect any other part of the system that might rely on the removed logic.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for usages of SignalThreshold to ensure the change doesn't affect other parts of the system.
rg --type go "SignalThreshold"
Length of output: 269
Script:
#!/bin/bash
# Search for any logic in the keeper.go file that might have depended on the version parameter in SignalThreshold.
rg --type go -C 10 "SignalThreshold" x/upgrade/keeper.go
Length of output: 1761
Closes #2987