Skip to content

Commit cdca295

Browse files
committed
feat(cmd): Hardcode big width for checkpatch to keep formatting
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
1 parent 9424d4d commit cdca295

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

cmd/governctl/pr/check/patch.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,17 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error {
107107

108108
cs := iostreams.G(ctx).ColorScheme()
109109

110-
table, err := tableprinter.NewTablePrinter(ctx,
110+
topts := []tableprinter.TablePrinterOption{
111111
tableprinter.WithOutputFormatFromString(opts.Output),
112-
tableprinter.WithMaxWidth(iostreams.G(ctx).TerminalWidth()),
113-
)
112+
}
113+
114+
if !kitcfg.G[config.Config](ctx).NoRender {
115+
topts = append(topts, tableprinter.WithMaxWidth(10000))
116+
} else {
117+
topts = append(topts, tableprinter.WithMaxWidth(iostreams.G(ctx).TerminalWidth()))
118+
}
119+
120+
table, err := tableprinter.NewTablePrinter(ctx, topts...)
114121
if err != nil {
115122
return err
116123
}
@@ -159,7 +166,7 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error {
159166
table.AddField(patch.Hash[0:7], nil)
160167
table.AddField(string(note.Level), level)
161168
table.AddField(note.Type, nil)
162-
table.AddField(note.Message, nil)
169+
table.AddField("\""+note.Message+"\"", nil)
163170
table.AddField(note.File, nil)
164171
table.AddField(fmt.Sprintf("%d", note.Line), nil)
165172
table.EndRow()

0 commit comments

Comments
 (0)