Skip to content

Commit

Permalink
fix: add missing verbose mode flags (#4286)
Browse files Browse the repository at this point in the history
* add missing verbose mode flags

* add changelog

* remove unused debug flag

(cherry picked from commit 3152cf5)

# Conflicts:
#	ignite/cmd/chain_lint.go
  • Loading branch information
Pantani authored and mergify[bot] committed Aug 2, 2024
1 parent f7f0c84 commit 1bd8a5e
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 7 deletions.
23 changes: 23 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@
- [#4262](https://github.com/ignite/cli/pull/4262) Bring back relayer command
- [#4269](https://github.com/ignite/cli/pull/4269) Add custom flag parser for extensions
- [#4270](https://github.com/ignite/cli/pull/4270) Add flags to the extension hooks commands
- [#4157](https://github.com/ignite/cli/pull/4157) Upgrade golang to 1.22
- [#4094](https://github.com/ignite/cli/pull/4094) Scaffolding a multi-index map using `ignite s map foo bar baz --index foobar,foobaz` is no longer supported. Use one index instead of use `collections.IndexedMap`.
- [#4058](https://github.com/ignite/cli/pull/4058) Simplify scaffolded modules by including `ValidateBasic()` logic in message handler.
- [#4058](https://github.com/ignite/cli/pull/4058) Use `address.Codec` instead of `AccAddressFromBech32`.
- [#3993](https://github.com/ignite/cli/pull/3993) Oracle scaffolding was deprecated and has been removed
- [#3962](https://github.com/ignite/cli/pull/3962) Rename all RPC endpoints and autocli commands generated for `map`/`list`/`single` types
- [#3976](https://github.com/ignite/cli/pull/3976) Remove error checks for Cobra command value get calls
- [#4002](https://github.com/ignite/cli/pull/4002) Bump buf build
- [#4008](https://github.com/ignite/cli/pull/4008) Rename `pkg/yaml` to `pkg/xyaml`
- [#4075](https://github.com/ignite/cli/pull/4075) Use `gopkg.in/yaml.v3` instead `gopkg.in/yaml.v2`
- [#4118](https://github.com/ignite/cli/pull/4118) Version scaffolded protos as `v1` to follow SDK structure.
- [#4167](https://github.com/ignite/cli/pull/4167) Scaffold `int64` instead of `int32` when a field type is `int`
- [#4159](https://github.com/ignite/cli/pull/4159) Enable gci linter
- [#4160](https://github.com/ignite/cli/pull/4160) Enable copyloopvar linter
- [#4162](https://github.com/ignite/cli/pull/4162) Enable errcheck linter
- [#4189](https://github.com/ignite/cli/pull/4189) Deprecate `ignite node` for `ignite connect` app

### Fixes

- [#4000](https://github.com/ignite/cli/pull/4000) Run all dry runners before the wet run in the `xgenny` pkg
- [#4091](https://github.com/ignite/cli/pull/4091) Fix race conditions in the plugin logic
- [#4128](https://github.com/ignite/cli/pull/4128) Check for duplicate proto fields in config
- [#4286](https://github.com/ignite/cli/pull/4286) Add missing verbose mode flags

## [`v28.5.0`](https://github.com/ignite/cli/releases/tag/v28.5.0)

Expand Down
2 changes: 1 addition & 1 deletion ignite/cmd/chain_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ for your current environment.
c.Flags().AddFlagSet(flagSetCheckDependencies())
c.Flags().AddFlagSet(flagSetSkipProto())
c.Flags().AddFlagSet(flagSetDebug())
c.Flags().AddFlagSet(flagSetVerbose())
c.Flags().Bool(flagRelease, false, "build for a release")
c.Flags().StringSliceP(flagReleaseTargets, "t", []string{}, "release targets. Available only with --release flag")
c.Flags().StringSlice(flagBuildTags, []string{}, "parameters to build the chain binary")
c.Flags().String(flagReleasePrefix, "", "tarball prefix for each release target. Available only with --release flag")
c.Flags().StringP(flagOutput, "o", "", "binary output path")
c.Flags().BoolP("verbose", "v", false, "verbose output")

return c
}
Expand Down
5 changes: 1 addition & 4 deletions ignite/cmd/chain_faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ func chainFaucetHandler(cmd *cobra.Command, args []string) error {
var (
toAddress = args[0]
coins = args[1]
session = cliui.New(
cliui.WithVerbosity(getVerbosity(cmd)),
cliui.StartSpinner(),
)
session = cliui.New(cliui.StartSpinner())
)
defer session.End()

Expand Down
1 change: 1 addition & 0 deletions ignite/cmd/chain_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ commands manually to ensure a production-level node initialization.
c.Flags().AddFlagSet(flagSetCheckDependencies())
c.Flags().AddFlagSet(flagSetSkipProto())
c.Flags().AddFlagSet(flagSetDebug())
c.Flags().AddFlagSet(flagSetVerbose())
c.Flags().StringSlice(flagBuildTags, []string{}, "parameters to build the chain binary")

return c
Expand Down
36 changes: 36 additions & 0 deletions ignite/cmd/chain_lint.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package ignitecmd

import (
"github.com/spf13/cobra"

"github.com/ignite/cli/v29/ignite/pkg/cliui"

Check failure on line 6 in ignite/cmd/chain_lint.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

no required module provides package github.com/ignite/cli/v29/ignite/pkg/cliui; to add it:

Check failure on line 6 in ignite/cmd/chain_lint.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

no required module provides package github.com/ignite/cli/v29/ignite/pkg/cliui; to add it:

Check failure on line 6 in ignite/cmd/chain_lint.go

View workflow job for this annotation

GitHub Actions / test network on ubuntu-latest

no required module provides package github.com/ignite/cli/v29/ignite/pkg/cliui; to add it:

Check failure on line 6 in ignite/cmd/chain_lint.go

View workflow job for this annotation

GitHub Actions / test network on macos-latest

no required module provides package github.com/ignite/cli/v29/ignite/pkg/cliui; to add it:
"github.com/ignite/cli/v29/ignite/services/chain"

Check failure on line 7 in ignite/cmd/chain_lint.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

no required module provides package github.com/ignite/cli/v29/ignite/services/chain; to add it:

Check failure on line 7 in ignite/cmd/chain_lint.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

no required module provides package github.com/ignite/cli/v29/ignite/services/chain; to add it:
)

// NewChainLint returns a lint command to build a blockchain app.
func NewChainLint() *cobra.Command {
c := &cobra.Command{
Use: "lint",
Short: "Lint codebase using golangci-lint",
Long: "The lint command runs the golangci-lint tool to lint the codebase.",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
session := cliui.New(cliui.StartSpinnerWithText("Linting..."))
defer session.End()

chainOption := []chain.Option{
chain.WithOutputer(session),
chain.CollectEvents(session.EventBus()),
}

c, err := chain.NewWithHomeFlags(cmd, chainOption...)
if err != nil {
return err
}

return c.Lint(cmd.Context())
},
}

return c
}
3 changes: 2 additions & 1 deletion ignite/cmd/chain_serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

const (
flagVerbose = "verbose"
flagConfig = "config"
flagForceReset = "force-reset"
flagGenerateClients = "generate-clients"
Expand Down Expand Up @@ -70,7 +71,7 @@ production, you may want to run "appd start" manually.
c.Flags().AddFlagSet(flagSetHome())
c.Flags().AddFlagSet(flagSetCheckDependencies())
c.Flags().AddFlagSet(flagSetSkipProto())
c.Flags().BoolP("verbose", "v", false, "verbose output")
c.Flags().AddFlagSet(flagSetVerbose())
c.Flags().BoolP(flagForceReset, "f", false, "force reset of the app state on start and every source change")
c.Flags().BoolP(flagResetOnce, "r", false, "reset the app state once on init")
c.Flags().Bool(flagGenerateClients, false, "generate code for the configured clients on reset or source code change")
Expand Down
8 changes: 7 additions & 1 deletion ignite/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,14 @@ To get started, create a blockchain:
}, nil
}

func flagSetVerbose() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.BoolP(flagVerbose, "v", false, "verbose output")
return fs
}

func getVerbosity(cmd *cobra.Command) uilog.Verbosity {
if verbose, _ := cmd.Flags().GetBool("verbose"); verbose {
if verbose, _ := cmd.Flags().GetBool(flagVerbose); verbose {
return uilog.VerbosityVerbose
}

Expand Down

0 comments on commit 1bd8a5e

Please sign in to comment.