@@ -12,8 +12,6 @@ import (
1212 "github.com/fatih/color"
1313 "github.com/jstemmer/go-junit-report/v2/junit"
1414 "github.com/olekukonko/tablewriter"
15- "github.com/olekukonko/tablewriter/renderer"
16- "github.com/olekukonko/tablewriter/tw"
1715 "github.com/owenrumney/go-sarif/v2/sarif"
1816
1917 outil "github.com/open-policy-agent/opa/v1/util"
@@ -208,16 +206,17 @@ func (tr FestiveReporter) Publish(ctx context.Context, r report.Report) error {
208206
209207func buildPrettyViolationsTable (violations []report.Violation ) string {
210208 sb := & strings.Builder {}
211- table := tablewriter .NewTable (sb , tablewriter .WithConfig (tablewriter.Config {
212- Row : tw.CellConfig {
213- Padding : tw.CellPadding {PerColumn : []tw.Padding {{Right : " " }, tw .PaddingDefault }},
214- },
215- }), tablewriter .WithRenderer (renderer .NewBlueprint (tw.Rendition {
216- Borders : tw .BorderNone ,
217- Settings : tw.Settings {
218- Separators : tw.Separators {BetweenRows : tw .Off , BetweenColumns : tw .Off },
219- },
220- })))
209+ table := tablewriter .NewWriter (sb )
210+
211+ table .SetNoWhiteSpace (true )
212+ table .SetTablePadding ("\t " )
213+ table .SetAlignment (tablewriter .ALIGN_LEFT )
214+ table .SetCenterSeparator ("" )
215+ table .SetColumnSeparator ("" )
216+ table .SetRowSeparator ("" )
217+ table .SetHeaderLine (false )
218+ table .SetBorder (false )
219+ table .SetAutoWrapText (false )
221220
222221 numViolations := len (violations )
223222
@@ -284,15 +283,13 @@ func (tr CompactReporter) Publish(_ context.Context, r report.Report) error {
284283 }
285284
286285 sb := & strings.Builder {}
287- table := tablewriter .NewTable (sb , tablewriter .WithConfig (tablewriter.Config {
288- Row : tw.CellConfig {
289- Formatting : tw.CellFormatting {AutoWrap : tw .WrapNormal },
290- Alignment : tw.CellAlignment {Global : tw .AlignLeft },
291- ColMaxWidths : tw.CellWidth {Global : 80 },
292- },
293- }))
294-
295- table .Header ([]string {"Location" , "Description" })
286+ table := tablewriter .NewWriter (sb )
287+
288+ table .SetHeader ([]string {"Location" , "Description" })
289+ table .SetAutoFormatHeaders (false )
290+
291+ table .SetColWidth (80 )
292+ table .SetAutoWrapText (true )
296293
297294 for i := range r .Violations {
298295 table .Append ([]string {r .Violations [i ].Location .String (), r .Violations [i ].Description })
0 commit comments