mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-24 06:35:40 +00:00
exclude lint errors to keep cobra params unchanged
This commit is contained in:
parent
072491c656
commit
7eef1a454e
@ -12,7 +12,7 @@ func createEvaluateAllCommand() *cobra.Command {
|
|||||||
Use: "eval-all [expression] [yaml_file1]...",
|
Use: "eval-all [expression] [yaml_file1]...",
|
||||||
Aliases: []string{"ea"},
|
Aliases: []string{"ea"},
|
||||||
Short: "Loads _all_ yaml documents of _all_ yaml files and runs expression once",
|
Short: "Loads _all_ yaml documents of _all_ yaml files and runs expression once",
|
||||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { //nolint:revive
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ func createEvaluateSequenceCommand() *cobra.Command {
|
|||||||
Use: "eval [expression] [yaml_file1]...",
|
Use: "eval [expression] [yaml_file1]...",
|
||||||
Aliases: []string{"e"},
|
Aliases: []string{"e"},
|
||||||
Short: "(default) Apply the expression to each document in each yaml file in sequence",
|
Short: "(default) Apply the expression to each document in each yaml file in sequence",
|
||||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { //nolint:revive
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ yq -P -oy sample.json
|
|||||||
return evaluateSequence(cmd, args)
|
return evaluateSequence(cmd, args)
|
||||||
|
|
||||||
},
|
},
|
||||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
PersistentPreRunE: func(cmd *cobra.Command, args []string) error { //nolint:revive
|
||||||
cmd.SetOut(cmd.OutOrStdout())
|
cmd.SetOut(cmd.OutOrStdout())
|
||||||
level := logging.WARNING
|
level := logging.WARNING
|
||||||
stringFormat := `[%{level}] %{color}%{time:15:04:05}%{color:reset} %{message}`
|
stringFormat := `[%{level}] %{color}%{time:15:04:05}%{color:reset} %{message}`
|
||||||
|
Loading…
Reference in New Issue
Block a user