Documentation
¶
Overview ¶
Package table provides a human-readable table output formatter for terminal display.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter struct {
// ShowRaw, when true, appends a trailing RAW column holding the unredacted
// secret value. When false, no RAW column is emitted at all.
ShowRaw bool
// ColorEnabled, when true, wraps severity text with ANSI color codes.
// Should be enabled only when writing to a terminal, not to files.
ColorEnabled bool
}
Formatter outputs findings as a human-readable table for terminal display.
func (*Formatter) FileExtension ¶
FileExtension returns the text file extension.
func (*Formatter) Format ¶
Format writes findings as a formatted table to the given writer. Columns: SEVERITY | DETECTOR | FILE | LINE | REDACTED | STATUS | REMEDIATION When ShowRaw is true, a trailing RAW column is appended. A summary line is appended at the bottom.
DetectorID, FilePath, and Redacted are attacker-influenced (a malicious file name or a permissive custom detector rule can embed arbitrary bytes) and are sanitized via output.SanitizeForDisplay before reaching this writer, which is a real terminal when the CLI is run interactively. This strips control/ANSI-escape bytes so a crafted finding cannot inject terminal escape sequences into the operator's session.