Skip to content

Commit 49c9ac8

Browse files
committed
Removed 'yaml' output from '--format' flag
1 parent 2d66dfa commit 49c9ac8

File tree

7 files changed

+6
-906
lines changed

7 files changed

+6
-906
lines changed

Diff for: .licenses/go/sigs.k8s.io/yaml.dep.yml

-317
This file was deleted.

Diff for: .licenses/go/sigs.k8s.io/yaml/goyaml.v2.dep.yml

-571
This file was deleted.

Diff for: docs/UPGRADING.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Here you can find a list of migration guides to handle breaking changes between
44

55
## 0.36.0
66

7+
### YAML output format is no more supported
8+
9+
The `yaml` option of the `--format` flag is no more supported. Use `--format json` if machine parsable output is needed.
10+
711
### The gRPC `cc.arduino.cli.commands.v1.CompileRequest.export_binaries` changed type.
812

913
Previously the field `export_binaries` was a `google.protobuf.BoolValue`. We used this type because it expresses this

Diff for: go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ require (
4444
google.golang.org/grpc v1.62.1
4545
google.golang.org/protobuf v1.33.0
4646
gopkg.in/yaml.v3 v3.0.1
47-
sigs.k8s.io/yaml v1.4.0
4847
)
4948

5049
require (

Diff for: go.sum

-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
8282
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
8383
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
8484
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
85-
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
8685
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
8786
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
8887
github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg=
@@ -300,5 +299,3 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
300299
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
301300
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
302301
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
303-
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
304-
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

Diff for: internal/cli/cli.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ func createCliCommandTree(cmd *cobra.Command) {
150150
cmd.RegisterFlagCompletionFunc("log-format", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
151151
return validLogFormats, cobra.ShellCompDirectiveDefault
152152
})
153-
validOutputFormats := []string{"text", "json", "jsonmini", "yaml"}
154-
cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", tr("The output format for the logs, can be: %s", strings.Join(validOutputFormats, ", ")))
153+
validOutputFormats := []string{"text", "json", "jsonmini"}
154+
cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", tr("The command output format, can be: %s", strings.Join(validOutputFormats, ", ")))
155155
cmd.RegisterFlagCompletionFunc("format", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
156156
return validOutputFormats, cobra.ShellCompDirectiveDefault
157157
})

Diff for: internal/cli/feedback/feedback.go

-12
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626

2727
"github.com/arduino/arduino-cli/internal/i18n"
2828
"github.com/sirupsen/logrus"
29-
"sigs.k8s.io/yaml"
3029
)
3130

3231
// OutputFormat is an output format
@@ -39,14 +38,11 @@ const (
3938
JSON
4039
// MinifiedJSON format
4140
MinifiedJSON
42-
// YAML format
43-
YAML
4441
)
4542

4643
var formats = map[string]OutputFormat{
4744
"json": JSON,
4845
"jsonmini": MinifiedJSON,
49-
"yaml": YAML,
5046
"text": Text,
5147
}
5248

@@ -204,8 +200,6 @@ func Fatal(errorMsg string, exitCode ExitCode) {
204200
d, _ = json.MarshalIndent(augment(res), "", " ")
205201
case MinifiedJSON:
206202
d, _ = json.Marshal(augment(res))
207-
case YAML:
208-
d, _ = yaml.Marshal(augment(res))
209203
default:
210204
panic("unknown output format")
211205
}
@@ -250,12 +244,6 @@ func PrintResult(res Result) {
250244
Fatal(tr("Error during JSON encoding of the output: %v", err), ErrGeneric)
251245
}
252246
data = string(d)
253-
case YAML:
254-
d, err := yaml.Marshal(augment(res.Data()))
255-
if err != nil {
256-
Fatal(tr("Error during YAML encoding of the output: %v", err), ErrGeneric)
257-
}
258-
data = string(d)
259247
case Text:
260248
data = res.String()
261249
if resErr, ok := res.(ErrorResult); ok {

0 commit comments

Comments
 (0)