Skip to content

Commit

Permalink
Merge pull request #851 from CosmWasm/gofumpt
Browse files Browse the repository at this point in the history
Gofumpt
  • Loading branch information
ethanfrey committed May 10, 2022
2 parents d671a69 + bff3aff commit 663716a
Show file tree
Hide file tree
Showing 82 changed files with 1,559 additions and 361 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,16 @@ test-sim-multi-seed-short: runsim
### Linting ###
###############################################################################

lint:
format-tools:
go install mvdan.cc/gofumpt@v0.3.1
go install github.com/client9/misspell/cmd/misspell@v0.3.4

lint: format-tools
golangci-lint run --tests=false
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofmt -d -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d -s

format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s
format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/CosmWasm/wasmd

Expand Down
2 changes: 1 addition & 1 deletion app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}

var sigGasConsumer = options.SigGasConsumer
sigGasConsumer := options.SigGasConsumer
if sigGasConsumer == nil {
sigGasConsumer = ante.DefaultSigVerificationGasConsumer
}
Expand Down
3 changes: 1 addition & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ func NewWasmApp(
wasmOpts []wasm.Option,
baseAppOptions ...func(*baseapp.BaseApp),
) *WasmApp {

appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry

Expand Down Expand Up @@ -552,7 +551,7 @@ func NewWasmApp(

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
// we prefer to be more strict in what arguments the modules expect.
var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))

// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
Expand Down
6 changes: 4 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ func TestAppImportExport(t *testing.T) {

storeKeysPrefixes := []StoreKeysPrefixes{
{app.keys[authtypes.StoreKey], newApp.keys[authtypes.StoreKey], [][]byte{}},
{app.keys[stakingtypes.StoreKey], newApp.keys[stakingtypes.StoreKey],
{
app.keys[stakingtypes.StoreKey], newApp.keys[stakingtypes.StoreKey],
[][]byte{
stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey,
stakingtypes.HistoricalInfoKey,
}},
},
},
{app.keys[slashingtypes.StoreKey], newApp.keys[slashingtypes.StoreKey], [][]byte{}},
{app.keys[minttypes.StoreKey], newApp.keys[minttypes.StoreKey], [][]byte{}},
{app.keys[distrtypes.StoreKey], newApp.keys[distrtypes.StoreKey], [][]byte{}},
Expand Down
1 change: 1 addition & 0 deletions app/test_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (s TestSupport) WasmKeeper() wasm.Keeper {
func (s TestSupport) AppCodec() codec.Codec {
return s.app.appCodec
}

func (s TestSupport) ScopedWasmIBCKeeper() capabilitykeeper.ScopedKeeper {
return s.app.scopedWasmKeeper
}
Expand Down
2 changes: 0 additions & 2 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ func SignCheckDeliver(
t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg,
chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error) {

tx, err := helpers.GenTx(
txCfg,
msgs,
Expand Down Expand Up @@ -343,7 +342,6 @@ func SignAndDeliver(
t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg,
chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error) {

tx, err := helpers.GenTx(
txCfg,
msgs,
Expand Down
1 change: 0 additions & 1 deletion cmd/wasmd/genwasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ func AddGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command {
wasmcli.GenesisListCodesCmd(defaultNodeHome, genesisIO),
)
return txCmd

}
2 changes: 0 additions & 2 deletions cmd/wasmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ func (ac appCreator) newApp(
traceStore io.Writer,
appOpts servertypes.AppOptions,
) servertypes.Application {

var cache sdk.MultiStorePersistentCache

if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) {
Expand Down Expand Up @@ -247,7 +246,6 @@ func (ac appCreator) appExport(
jailAllowedAddrs []string,
appOpts servertypes.AppOptions,
) (servertypes.ExportedApp, error) {

var wasmApp *app.WasmApp
homePath, ok := appOpts.Get(flags.FlagHome).(string)
if !ok || homePath == "" {
Expand Down
Loading

0 comments on commit 663716a

Please sign in to comment.