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: format once with gofumpt #797

Merged
merged 3 commits into from
Apr 12, 2022
Merged

chore: format once with gofumpt #797

merged 3 commits into from
Apr 12, 2022

Conversation

toteki
Copy link
Member

@toteki toteki commented Apr 11, 2022

Description

Formatting pass using gofumpt, a stricter gofmt

gofumpt -l -w .

gofumpt -l -w -extra .

It might be worth using this in CI like a linter.

No functionality changes, so probably doesn't need a changelog.

@toteki toteki added the C:Tools label Apr 11, 2022
@toteki toteki requested a review from a team as a code owner April 11, 2022 21:59
return sdk.NewDecWithPrec(050, 3).Add(sdk.NewDecWithPrec(int64(r.Intn(950)), 3))
return sdk.NewDecWithPrec(50, 3).Add(sdk.NewDecWithPrec(int64(r.Intn(950)), 3))
Copy link
Member Author

@toteki toteki Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: formatter actually wanted to change this to 0o050 (octal), which is not what the code was intended to do, but is what it was actually doing.

Manually removed leading zeroes in the three lines changed for this file.

@@ -46,7 +46,7 @@ func (s *IntegrationTestSuite) SetupTest() {
}

// CreateTestTx is a helper function to create a tx given multiple inputs.
func (suite *IntegrationTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) {
func (suite *IntegrationTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) {
Copy link
Collaborator

@adamewozniak adamewozniak Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo defining parameter types like accNums []uint64, accSeqs []uint64, becomes a lot more readable when it comes to longer function definitions, so we probably shouldn't enforce it in CI - wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally favor the shortened ones, except when they're separated by newlines in which case each one gets a type.

But CI could be overkill either way

Copy link
Collaborator

@adamewozniak adamewozniak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm :^)

@toteki toteki merged commit 2802898 into main Apr 12, 2022
@toteki toteki deleted the adam/fmt branch April 12, 2022 13:27
mergify bot pushed a commit that referenced this pull request Apr 12, 2022
* gofumpt -l -w .

* gofumpt -l -w -extra .

* remove unintentional octal

(cherry picked from commit 2802898)
mergify bot pushed a commit that referenced this pull request Apr 12, 2022
* gofumpt -l -w .

* gofumpt -l -w -extra .

* remove unintentional octal

(cherry picked from commit 2802898)
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.

2 participants