From c81038cf245c51c8c5d9ae2ac06220511f583b8a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:51:39 +0000 Subject: [PATCH] chore: improve align cli help (backport #18179) (#18187) Co-authored-by: Julien Robert --- .golangci.yml | 1 + x/auth/vesting/autocli.go | 5 ++--- x/bank/autocli.go | 11 +++++------ x/bank/migrations/v4/gen_state_test.go | 2 +- x/circuit/autocli.go | 6 +++--- x/distribution/autocli.go | 5 ----- x/feegrant/module/autocli.go | 7 ++----- x/group/module/autocli.go | 20 ++++++++++---------- x/staking/autocli.go | 1 - 9 files changed, 24 insertions(+), 34 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index a589118d386e..3f61e47a961e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,6 +7,7 @@ run: skip-files: - server/grpc/gogoreflection/fix_registration.go - "fix_registration.go" + - "x/bank/migrations/v4/gen_state_test.go" - ".*\\.pb\\.go$" - ".*\\.pb\\.gw\\.go$" - ".*\\.pulsar\\.go$" diff --git a/x/auth/vesting/autocli.go b/x/auth/vesting/autocli.go index 5ae6ff88e419..2ff4585db1ae 100644 --- a/x/auth/vesting/autocli.go +++ b/x/auth/vesting/autocli.go @@ -33,9 +33,8 @@ timestamp.`, RpcMethod: "CreatePermanentLockedAccount", Use: "create-permanent-locked-account [to_address] [amount]", Short: "Create a new permanently locked account funded with an allocation of tokens.", - Long: `Create a new account funded with an allocation of permanently locked tokens. These - tokens may be used for staking but are non-transferable. Staking rewards will acrue as liquid and transferable - tokens.`, + Long: `Create a new account funded with an allocation of permanently locked tokens. +These tokens may be used for staking but are non-transferable. Staking rewards will acrue as liquid and transferable tokens.`, PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "to_address"}, {ProtoField: "amount", Varargs: true}, diff --git a/x/bank/autocli.go b/x/bank/autocli.go index 7bb1b571c2a2..4224dbafacd1 100644 --- a/x/bank/autocli.go +++ b/x/bank/autocli.go @@ -79,9 +79,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Short: "Query for send enabled entries", Long: strings.TrimSpace(`Query for send enabled entries that have been specifically set. - To look up one or more specific denoms, supply them as arguments to this command. - To look up all denoms, do not provide any arguments. - `, +To look up one or more specific denoms, supply them as arguments to this command. +To look up all denoms, do not provide any arguments.`, ), PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denoms"}}, }, @@ -96,9 +95,9 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "send [from_key_or_address] [to_address] [amount]", Short: "Send funds from one account to another.", Long: `Send funds from one account to another. - Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. - When using '--dry-run' a key name cannot be used, only a bech32 address. - Note: multiple coins can be send by space separated.`, +Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. +When using '--dry-run' a key name cannot be used, only a bech32 address. +Note: multiple coins can be send by space separated.`, PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "to_address"}, {ProtoField: "amount", Varargs: true}}, }, { diff --git a/x/bank/migrations/v4/gen_state_test.go b/x/bank/migrations/v4/gen_state_test.go index b5123d8d893a..3cbd40b86edd 100644 --- a/x/bank/migrations/v4/gen_state_test.go +++ b/x/bank/migrations/v4/gen_state_test.go @@ -156,6 +156,6 @@ func TestMigrateGenState(t *testing.T) { }, } _ = v4.MigrateGenState(&origState) - assert.Len(t, origState.Params.SendEnabled, 2) //nolint:staticcheck // SA1019: keep for test + assert.Len(t, origState.Params.SendEnabled, 2) //nolint:staticcheck // keep for test }) } diff --git a/x/circuit/autocli.go b/x/circuit/autocli.go index 1bb272253ad1..de72b3dc28b5 100644 --- a/x/circuit/autocli.go +++ b/x/circuit/autocli.go @@ -40,9 +40,9 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Use: "authorize [grantee] [permissions_json] --from [granter]", Short: "Authorize an account to trip the circuit breaker.", Long: `Authorize an account to trip the circuit breaker. - "SOME_MSGS" = 1, - "ALL_MSGS" = 2, - "SUPER_ADMIN" = 3,`, +"SOME_MSGS" = 1, +"ALL_MSGS" = 2, +"SUPER_ADMIN" = 3,`, Example: fmt.Sprintf(`%s circuit authorize [address] '{"level":1,"limit_type_urls":["cosmos.bank.v1beta1.MsgSend,cosmos.bank.v1beta1.MsgMultiSend"]}'"`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "grantee"}, diff --git a/x/distribution/autocli.go b/x/distribution/autocli.go index fa0d9915bcbf..36908eaf92c9 100644 --- a/x/distribution/autocli.go +++ b/x/distribution/autocli.go @@ -9,11 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/version" ) -var ( - FlagCommission = "commission" - FlagMaxMessagesPerTx = "max-msgs" -) - // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ diff --git a/x/feegrant/module/autocli.go b/x/feegrant/module/autocli.go index 3ba095376ab1..57e1ae4f21c7 100644 --- a/x/feegrant/module/autocli.go +++ b/x/feegrant/module/autocli.go @@ -2,7 +2,6 @@ package module import ( "fmt" - "strings" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" feegrantv1beta1 "cosmossdk.io/api/cosmos/feegrant/v1beta1" @@ -19,10 +18,8 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "Allowance", Use: "grant [granter] [grantee]", Short: "Query details of a single grant", - Long: strings.TrimSpace( - `Query details for a grant. -You can find the fee-grant of a granter and grantee.`), - Example: fmt.Sprintf(`$ %s query feegrant grant [granter] [grantee]`, version.AppName), + Long: "Query details for a grant. You can find the fee-grant of a granter and grantee.", + Example: fmt.Sprintf(`$ %s query feegrant grant [granter] [grantee]`, version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "granter"}, {ProtoField: "grantee"}, diff --git a/x/group/module/autocli.go b/x/group/module/autocli.go index f5386f91efe2..e51f310dfeed 100644 --- a/x/group/module/autocli.go +++ b/x/group/module/autocli.go @@ -171,16 +171,16 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "Vote", Use: "vote [proposal-id] [voter] [vote-option] [metadata]", Long: `Vote on a proposal. - Parameters: - proposal-id: unique ID of the proposal - voter: voter account addresses. - vote-option: choice of the voter(s) - VOTE_OPTION_UNSPECIFIED: no-op - VOTE_OPTION_NO: no - VOTE_OPTION_YES: yes - VOTE_OPTION_ABSTAIN: abstain - VOTE_OPTION_NO_WITH_VETO: no-with-veto - Metadata: metadata for the vote +Parameters: + proposal-id: unique ID of the proposal + voter: voter account addresses. + vote-option: choice of the voter(s) + VOTE_OPTION_UNSPECIFIED: no-op + VOTE_OPTION_NO: no + VOTE_OPTION_YES: yes + VOTE_OPTION_ABSTAIN: abstain + VOTE_OPTION_NO_WITH_VETO: no-with-veto + Metadata: metadata for the vote `, PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "proposal_id"}, {ProtoField: "voter"}, {ProtoField: "option"}, {ProtoField: "metadata"}, diff --git a/x/staking/autocli.go b/x/staking/autocli.go index 8a5ca421b751..16335d38ec13 100644 --- a/x/staking/autocli.go +++ b/x/staking/autocli.go @@ -120,7 +120,6 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "HistoricalInfo", Use: "historical-info [height]", Short: "Query historical info at given height", - Long: "Query historical info at given height.", Example: fmt.Sprintf("$ %s query staking historical-info 5", version.AppName), PositionalArgs: []*autocliv1.PositionalArgDescriptor{ {ProtoField: "height"},