-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: fix lint issues + gofumpt #15062
Conversation
@@ -44,7 +44,7 @@ | |||
|
|||
func (c *ChainInfo) getCacheDir() (string, error) { | |||
cacheDir := path.Join(c.ConfigDir, "cache") | |||
return cacheDir, os.MkdirAll(cacheDir, 0755) | |||
return cacheDir, os.MkdirAll(cacheDir, 0o755) |
Check failure
Code scanning / gosec
Expect directory permissions to be 0750 or less
@@ -49,12 +49,12 @@ | |||
return err | |||
} | |||
|
|||
if err := os.MkdirAll(configDir, 0755); err != nil { | |||
if err := os.MkdirAll(configDir, 0o755); err != nil { |
Check failure
Code scanning / gosec
Expect directory permissions to be 0750 or less
@@ -133,7 +133,7 @@ | |||
return err | |||
} | |||
|
|||
err = os.WriteFile(appOptsFilename, bz, 0644) | |||
err = os.WriteFile(appOptsFilename, bz, 0o644) |
Check failure
Code scanning / gosec
Expect WriteFile permissions to be 0600 or less
@@ -92,7 +92,7 @@ | |||
return err | |||
} | |||
|
|||
if err = os.WriteFile(fdsFilename, bz, 0644); err != nil { | |||
if err = os.WriteFile(fdsFilename, bz, 0o644); err != nil { |
Check failure
Code scanning / gosec
Expect WriteFile permissions to be 0600 or less
return err | ||
} | ||
|
||
configPath := configFilename(configDir) | ||
if err := os.WriteFile(configPath, buf.Bytes(), 0644); err != nil { | ||
if err := os.WriteFile(configPath, buf.Bytes(), 0o644); err != nil { |
Check failure
Code scanning / gosec
Expect WriteFile permissions to be 0600 or less
@@ -37,135 +37,135 @@ const RootCodespace = "sdk" | |||
|
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.
Shouldn't we remove the aliases from above?
They've been deprecated since v0.46.
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.
There was a build failing because x/upgrade was using this one iirc. Should we keep them until we tag new versions of everything and then remove it?
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.
Yeah makes sense
store/snapshots/stream.go
Outdated
@@ -5,8 +5,7 @@ import ( | |||
"compress/zlib" | |||
"io" | |||
|
|||
"cosmossdk.io/errors" | |||
|
|||
errorsmod "cosmossdk.io/errors" |
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.
is this linting error? we should try to leave these unchanged
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.
Ah ok I was doing those for consistency
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.
I thought I was following a pattern, but it was the wrong pattern lol. So I'm changing any import that doesn't have a conflicting import name to be just cosmossdk.io/errors
. I was confused because I've seen many places in which the old error package was imported as "sdkerrors" even when there wasn't another package with the same name
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!
Description
I'm so sorry for the big diff. It's mostly replacing the old errors with the new cosmossdk.io/errors + some other linter fixes.
Closes: #XXXX
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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.
I have...
!
in the type prefix if API or client breaking change