Skip to content

Commit

Permalink
feat(cmd): Hardcode big width for checkpatch to keep formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <[email protected]>
  • Loading branch information
craciunoiuc committed Dec 12, 2023
1 parent 9424d4d commit cdca295
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cmd/governctl/pr/check/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit cdca295

Please sign in to comment.