From cdca2956e0c4dca9695037a2502a961cac6acb3b Mon Sep 17 00:00:00 2001 From: Cezar Craciunoiu Date: Tue, 12 Dec 2023 14:52:23 +0200 Subject: [PATCH] feat(cmd): Hardcode big width for checkpatch to keep formatting Signed-off-by: Cezar Craciunoiu --- cmd/governctl/pr/check/patch.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmd/governctl/pr/check/patch.go b/cmd/governctl/pr/check/patch.go index ccf44e3..d605c0f 100644 --- a/cmd/governctl/pr/check/patch.go +++ b/cmd/governctl/pr/check/patch.go @@ -107,10 +107,17 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error { cs := iostreams.G(ctx).ColorScheme() - table, err := tableprinter.NewTablePrinter(ctx, + topts := []tableprinter.TablePrinterOption{ tableprinter.WithOutputFormatFromString(opts.Output), - tableprinter.WithMaxWidth(iostreams.G(ctx).TerminalWidth()), - ) + } + + if !kitcfg.G[config.Config](ctx).NoRender { + topts = append(topts, tableprinter.WithMaxWidth(10000)) + } else { + topts = append(topts, tableprinter.WithMaxWidth(iostreams.G(ctx).TerminalWidth())) + } + + table, err := tableprinter.NewTablePrinter(ctx, topts...) if err != nil { return err } @@ -159,7 +166,7 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error { table.AddField(patch.Hash[0:7], nil) table.AddField(string(note.Level), level) table.AddField(note.Type, nil) - table.AddField(note.Message, nil) + table.AddField("\""+note.Message+"\"", nil) table.AddField(note.File, nil) table.AddField(fmt.Sprintf("%d", note.Line), nil) table.EndRow()