Add pre-commit#12
Open
acontry wants to merge 5 commits intorocket-pool:masterfrom
Open
Conversation
acontry
commented
Oct 28, 2022
| if err := rocketMinipoolManager.Call(opts, newMinipoolCounts, "getMinipoolCountPerStatus", offset, limit); err != nil { | ||
| return MinipoolCountsPerStatus{}, fmt.Errorf("Could not get minipool counts: %w", err) | ||
| } | ||
| if newMinipoolCounts != nil { |
Contributor
Author
There was a problem hiding this comment.
Linter flagged that this is always true
| smoothingPoolRegistrationState bool | ||
| smoothingPoolRegistrationChanged *big.Int | ||
| } | ||
| //type nodeDetails_Native struct { |
Contributor
Author
There was a problem hiding this comment.
This is unused, but looks like active development so commented it out.
| } | ||
|
|
||
| // Wait for a transaction to be mined and get a tx receipt | ||
| func (c *Contract) getTransactionReceipt(tx *types.Transaction) (*types.Receipt, error) { |
Contributor
Author
There was a problem hiding this comment.
Unused method. Since no recent development on this, deleted.
| length := new(*big.Int) | ||
| if err := addressQueueStorage.Call(opts, length, "getIndexOf", key); err != nil { | ||
| return 0, fmt.Errorf("Could not get address queue length for key: %w", key, err) | ||
| return 0, fmt.Errorf("Could not get address queue length for key %x: %w", key, err) |
Contributor
Author
There was a problem hiding this comment.
Chose %x lower-case hexadecimal repr for [32]bytes object
Comment on lines
+46
to
+47
| // TODO: Update to `NewKeyedTransactorWithChainID` | ||
| opts := bind.NewKeyedTransactor(a.PrivateKey) //nolint:all |
Contributor
Author
There was a problem hiding this comment.
Deprecated method. Can pick up in future PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a simple pre-commit config that uses golangci-lint.
I ran this by installing pre-commit, then
pre-commit run --all-filesand fixed all issues it raised. Most issues are cosmetic, but there did seem to be a couple very minor things that will functionally improve the codebase.I think pre-commit a nice tool to enforce a style standard and catch some classes of errors. I typically run it locally with
pre-commit installso it runs automatically on everygit commit, and also in CI (I've used it in github CI in open source).Feel free to cherry-pick from this PR if you don't want to add more tooling just yet. Happy to help integrate this into CI if you're interested though.