output

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorSeverity

func ColorSeverity(sev models.Severity, colored bool) string

ColorSeverity wraps a severity string with ANSI codes when colored is true. When colored is false the string is returned unchanged (CI-safe default).

func RenderTable

func RenderTable(w io.Writer, findings []models.Finding, opts TableOptions)

RenderTable writes a formatted findings table to w. Columns are dynamically selected based on opts; the separator line width is derived from the header row so all rows align correctly.

Column order:

RESOURCE ID  [PROFILE]  LOCATION  SEVERITY  [DOMAIN]  TYPE  MESSAGE  [SAVINGS/MO]

func ShortenMessage

func ShortenMessage(msg string, max int) string

ShortenMessage truncates msg to at most max runes, appending "..." when truncated. max is treated as at least 4 to guarantee space for the ellipsis.

Types

type TableOptions

type TableOptions struct {
	// Colored wraps severity labels with ANSI codes. Default false (CI-safe).
	Colored bool

	// IncludeSavings adds a SAVINGS/MO column when any finding has EstimatedMonthlySavings > 0.
	IncludeSavings bool

	// IncludeDomain adds a DOMAIN column.
	IncludeDomain bool

	// IncludeProfile adds a PROFILE column (useful with --all-profiles).
	IncludeProfile bool

	// LocationLabel is the column header for the region/context column.
	// Defaults to "REGION". Use "CONTEXT" for Kubernetes audits.
	LocationLabel string
}

TableOptions controls which columns RenderTable renders and how severity is coloured.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL