-
Notifications
You must be signed in to change notification settings - Fork 278
sync: coreth PR #1279: style: forbidigo t.Fatal #1849
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
base: master
Are you sure you want to change the base?
sync: coreth PR #1279: style: forbidigo t.Fatal #1849
Conversation
Signed-off-by: Jonathan Oppenheimer <[email protected]>
| } | ||
| default: | ||
| t.Fatalf("unknown step: %d", step) | ||
| require.Failf(t, "unknown step", "got: %d", step) |
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.
This is an overreaching linter that replaces stdlib features with something that does nothing more than require the user to know that it's the same thing.
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.
We need this linter to be added for the monorepo goal. Is there a better way of doing this? There could be a nolint clause instead
alarso16
left a comment
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.
The point of the linter is to use the helper functions. require.Fail should be avoided whenever possible
|
What's with the goleak failures? It's weird because the |
Co-authored-by: Austin Larson <[email protected]> Signed-off-by: Jonathan Oppenheimer <[email protected]>
alarso16
left a comment
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.
Last comment probably
alarso16
left a comment
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.
We should fix the licensing on this file and exclude these changes first
52bb4cd to
25db6a9
Compare
Done -- see #1865 |
|
This blocked by this PR |
Signed-off-by: Jonathan Oppenheimer <[email protected]>
| # - pattern: require\.Error$(# ErrorIs should be used instead)? | ||
| # - pattern: require\.ErrorContains$(# ErrorIs should be used instead)? | ||
| # - pattern: require\.EqualValues$(# Equal should be used instead)? | ||
| # - pattern: require\.NotEqualValues$(# NotEqual should be used instead)? | ||
| - pattern: ^(t|b|tb|f)\.(Fatal|Fatalf|Error|Errorf)$(# the require library should be used instead)? | ||
| - pattern: ^sort\.(Slice|Strings)$(# the slices package should be used instead)? | ||
| # - pattern: ^sort\.(Slice|Strings)$(# the slices package should be used instead)? |
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.
why these are commented out?
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.
These are commented out as to not make this PR overly large (and it's already a massive PR).
These linters will be added in a seperate PR.
Co-authored-by: Ceyhun Onur <[email protected]> Signed-off-by: Jonathan Oppenheimer <[email protected]>
| // the next upgradeBytes. (only check the result on the last apply) | ||
| if i != len(tt.configs)-1 { | ||
| require.NoError(t, err, "expecting checkConfigCompatible call %d to return nil", i+1) | ||
| require.Nil(t, err, "expecting checkConfigCompatible call %d to return nil", i+1) |
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.
These actually have to be nil
Signed-off-by: Jonathan Oppenheimer <[email protected]>
Syncs ava-labs/coreth#1279.
Note: The first commit 96fc992 is a perfect cherry pick of the coreth changes. These should not be reviewed stringently -- if you have changes, make them to coreth first~
The second commit 1a0ecea contains subnet-evm specific changes and should be reviewed as normal
--