Skip to content

Commit

Permalink
add thelper to linter and bump the linter's version (cosmos#2394)
Browse files Browse the repository at this point in the history
Co-authored-by: Marius Poke <marius.poke@posteo.de>
  • Loading branch information
faddat and mpoke authored Apr 21, 2023
1 parent cb523c0 commit e093d82
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ linters:
- staticcheck
- stylecheck
- typecheck
- thelper
- unconvert
- unparam
- unused
Expand Down
6 changes: 3 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ func RegisterSwaggerAPI(rtr *mux.Router) {
rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer))
}

func (app *GaiaApp) OnTxSucceeded(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) {
func (app *GaiaApp) OnTxSucceeded(_ sdk.Context, _, _ string, _ []byte, _ []byte) {
}

func (app *GaiaApp) OnTxFailed(ctx sdk.Context, sourcePort, sourceChannel string, txHash []byte, txBytes []byte) {
func (app *GaiaApp) OnTxFailed(_ sdk.Context, _, _ string, _ []byte, _ []byte) {
}

// TestingApp functions
Expand All @@ -436,6 +436,6 @@ func (app *GaiaApp) GetTxConfig() client.TxConfig {
type EmptyAppOptions struct{}

// Get implements AppOptions
func (ao EmptyAppOptions) Get(o string) interface{} {
func (ao EmptyAppOptions) Get(_ string) interface{} {
return nil
}
2 changes: 1 addition & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

type EmptyAppOptions struct{}

func (ao EmptyAppOptions) Get(o string) interface{} {
func (ao EmptyAppOptions) Get(_ string) interface{} {
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (pv PV) GetPubKey() (crypto.PubKey, error) {

type EmptyAppOptions struct{}

func (EmptyAppOptions) Get(o string) interface{} { return nil }
func (EmptyAppOptions) Get(_ string) interface{} { return nil }

func Setup(t *testing.T) *gaiaapp.GaiaApp {
t.Helper()
Expand Down Expand Up @@ -148,6 +148,7 @@ func genesisStateWithValSet(t *testing.T,
valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount,
balances ...banktypes.Balance,
) gaiaapp.GenesisState {
t.Helper()
// set genesis accounts
authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs)
genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis)
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v7/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
keepers *keepers.AppKeepers,
_ *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
vm[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion()
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v9/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
keepers *keepers.AppKeepers,
_ *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("Starting module migrations...")
Expand Down
1 change: 1 addition & 0 deletions x/globalfee/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func TestInitExportGenesis(t *testing.T) {
}

func setupTestStore(t *testing.T) (sdk.Context, simappparams.EncodingConfig, paramstypes.Subspace) {
t.Helper()
db := dbm.NewMemDB()
ms := store.NewCommitMultiStore(db)
encCfg := simapp.MakeTestEncodingConfig()
Expand Down
16 changes: 8 additions & 8 deletions x/globalfee/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
})
}

func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error {
func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error {
var data types.GenesisState
err := marshaler.UnmarshalJSON(message, &data)
if err != nil {
Expand All @@ -51,10 +51,10 @@ func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client
return nil
}

func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
func (a AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) {
}

func (a AppModuleBasic) RegisterRESTRoutes(context client.Context, router *mux.Router) {
func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {
}

func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
Expand All @@ -73,7 +73,7 @@ func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd()
}

func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) {
func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {
}

type AppModule struct {
Expand Down Expand Up @@ -103,7 +103,7 @@ func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) jso
return marshaler.MustMarshalJSON(&genState)
}

func (a AppModule) RegisterInvariants(registry sdk.InvariantRegistry) {
func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {
}

func (a AppModule) Route() sdk.Route {
Expand All @@ -114,18 +114,18 @@ func (a AppModule) QuerierRoute() string {
return types.QuerierRoute
}

func (a AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier {
func (a AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier {
return nil
}

func (a AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), NewGrpcQuerier(a.paramSpace))
}

func (a AppModule) BeginBlock(context sdk.Context, block abci.RequestBeginBlock) {
func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
}

func (a AppModule) EndBlock(context sdk.Context, block abci.RequestEndBlock) []abci.ValidatorUpdate {
func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return nil
}

Expand Down

0 comments on commit e093d82

Please sign in to comment.