celestiaorg / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Other
19 stars 33 forks source link

`make lint` results in errors #323

Closed rootulp closed 1 year ago

rootulp commented 1 year ago

Context

https://github.com/celestiaorg/cosmos-sdk/pull/320#issuecomment-1567238186

Problem

On https://github.com/celestiaorg/cosmos-sdk/tree/release/v0.46.x-celestia when I run make lint locally, I observe many errors

~/git/rootulp/celestia/cosmos-sdk on release/v0.46.x-celestia
$ make lint

...
x/nft/msgs.go:32:10: SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
        return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid receiver address (%s)", m.Receiver)
               ^
x/nft/validation.go:24:10: SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
        return sdkerrors.Wrapf(ErrInvalidClassID, "invalid class id: %s", id)
               ^
x/nft/validation.go:32:10: SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
        return sdkerrors.Wrapf(ErrInvalidID, "invalid nft id: %s", id)

Proposal

Fix lint issues

rootulp commented 1 year ago

Upstream https://github.com/cosmos/cosmos-sdk/tree/v0.46.12 appears to contain lint issues

$ gco v0.46.12
$ make lint
--> Running linter
types/tx/types.go:16: File is not `gofumpt`-ed (gofumpt)
var _, _, _, _ codectypes.UnpackInterfacesMessage = &Tx{}, &TxBody{}, &AuthInfo{}, &SignerInfo{}
var _ sdk.Tx = &Tx{}
crypto/keyring/keyring.go:722:14: G306: Expect WriteFile permissions to be 0600 or less (gosec)
            if err := os.WriteFile(dir+"/keyhash", passwordHash, 0o555); err != nil {
                      ^
codec/types/any.go:61:15: SA1019: sdkerrors.Wrap is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
        return nil, sdkerrors.Wrap(sdkerrors.ErrPackAny, "Expecting non nil value to create a new Any")
                    ^
snapshots/types/convert.go:20:22: SA1019: sdkerrors.Wrap is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
        return Snapshot{}, sdkerrors.Wrap(err, "failed to unmarshal snapshot metadata")
                           ^
snapshots/types/convert.go:36:27: SA1019: sdkerrors.Wrap is deprecated: functionality of this package has been moved to it's own module: (staticcheck)
        return abci.Snapshot{}, sdkerrors.Wrap(err, "failed to marshal snapshot metadata")
                                ^
...
make: *** [lint] Error 1
rootulp commented 1 year ago

Hmm https://github.com/cosmos/cosmos-sdk/actions/runs/4601524524/jobs/8129480693#step:4:23 didn't report any issues

rootulp commented 1 year ago

Created https://github.com/cosmos/cosmos-sdk/issues/16543 b/c the bump to 0.46.13 didn't resolve

rootulp commented 1 year ago

Closing as won't do b/c https://github.com/cosmos/cosmos-sdk/issues/16543#issuecomment-1591310730 and we likely don't want to increase the diff between this repo and upstream to fix lint issues.