From d1b153c6dc8ec0bb672eaa7c60a1714d990eb475 Mon Sep 17 00:00:00 2001 From: Sam Coe Date: Fri, 2 Apr 2021 09:43:33 -0700 Subject: [PATCH] Yaml to YAML --- pkg/cmd/workflow/view/view.go | 8 ++++---- pkg/cmd/workflow/view/view_test.go | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/cmd/workflow/view/view.go b/pkg/cmd/workflow/view/view.go index a39b84f8e..f32633aaf 100644 --- a/pkg/cmd/workflow/view/view.go +++ b/pkg/cmd/workflow/view/view.go @@ -30,7 +30,7 @@ type ViewOptions struct { Web bool Prompt bool Raw bool - Yaml bool + YAML bool } func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Command { @@ -74,7 +74,7 @@ func NewCmdView(f *cmdutil.Factory, runF func(*ViewOptions) error) *cobra.Comman } cmd.Flags().BoolVarP(&opts.Web, "web", "w", false, "Open workflow in the browser") - cmd.Flags().BoolVarP(&opts.Yaml, "yaml", "y", false, "View the workflow yaml file") + cmd.Flags().BoolVarP(&opts.YAML, "yaml", "y", false, "View the workflow yaml file") cmd.Flags().StringVarP(&opts.Ref, "ref", "r", "", "The branch or tag name which contains the version of the workflow file you'd like to view") return cmd @@ -102,7 +102,7 @@ func runView(opts *ViewOptions) error { if opts.Web { var url string hostname := repo.RepoHost() - if opts.Yaml { + if opts.YAML { ref := opts.Ref if ref == "" { opts.IO.StartProgressIndicator() @@ -123,7 +123,7 @@ func runView(opts *ViewOptions) error { return opts.Browser.Browse(url) } - if opts.Yaml { + if opts.YAML { err = viewWorkflowContent(opts, client, workflow) } else { err = viewWorkflowInfo(opts, client, workflow) diff --git a/pkg/cmd/workflow/view/view_test.go b/pkg/cmd/workflow/view/view_test.go index 2c14b5042..434cf0c83 100644 --- a/pkg/cmd/workflow/view/view_test.go +++ b/pkg/cmd/workflow/view/view_test.go @@ -77,7 +77,7 @@ func TestNewCmdView(t *testing.T) { tty: true, wants: ViewOptions{ Prompt: true, - Yaml: true, + YAML: true, }, }, { @@ -85,7 +85,7 @@ func TestNewCmdView(t *testing.T) { cli: "-y 123", wants: ViewOptions{ Raw: true, - Yaml: true, + YAML: true, Selector: "123", }, }, @@ -144,7 +144,7 @@ func TestNewCmdView(t *testing.T) { assert.Equal(t, tt.wants.Web, gotOpts.Web) assert.Equal(t, tt.wants.Prompt, gotOpts.Prompt) assert.Equal(t, tt.wants.Raw, gotOpts.Raw) - assert.Equal(t, tt.wants.Yaml, gotOpts.Yaml) + assert.Equal(t, tt.wants.YAML, gotOpts.YAML) }) } } @@ -231,7 +231,7 @@ func TestViewRun(t *testing.T) { tty: true, opts: &ViewOptions{ Selector: "123", - Yaml: true, + YAML: true, Web: true, }, httpStubs: func(reg *httpmock.Registry) { @@ -252,7 +252,7 @@ func TestViewRun(t *testing.T) { opts: &ViewOptions{ Selector: "123", Ref: "base", - Yaml: true, + YAML: true, Web: true, }, httpStubs: func(reg *httpmock.Registry) { @@ -268,7 +268,7 @@ func TestViewRun(t *testing.T) { tty: true, opts: &ViewOptions{ Selector: "123", - Yaml: true, + YAML: true, }, httpStubs: func(reg *httpmock.Registry) { reg.Register( @@ -287,7 +287,7 @@ func TestViewRun(t *testing.T) { tty: false, opts: &ViewOptions{ Selector: "123", - Yaml: true, + YAML: true, }, httpStubs: func(reg *httpmock.Registry) { reg.Register( @@ -306,7 +306,7 @@ func TestViewRun(t *testing.T) { tty: true, opts: &ViewOptions{ Selector: "123", - Yaml: true, + YAML: true, }, httpStubs: func(reg *httpmock.Registry) { reg.Register( @@ -327,7 +327,7 @@ func TestViewRun(t *testing.T) { opts: &ViewOptions{ Selector: "123", Ref: "456", - Yaml: true, + YAML: true, }, httpStubs: func(reg *httpmock.Registry) { reg.Register(