Documentation
¶
Overview ¶
Package render prints diffs as colored terminal output or markdown.
Index ¶
- func AuditMarkdown(w io.Writer, diffs []diffx.FileDiff, sum diffx.Summary, ...)
- func AuditTerminal(w io.Writer, diffs []diffx.FileDiff, sum diffx.Summary, ...)
- func Markdown(w io.Writer, diffs []diffx.FileDiff, sum diffx.Summary, ...)
- func QueueMarkdown(w io.Writer, heading, noun string, rows []QueueRow, ...)
- func QueueTerminal(w io.Writer, heading, noun, refHint string, rows []QueueRow, ...)
- func SARIF(w io.Writer, diffs []diffx.FileDiff, toolVersion string, ...) error
- func SARIFAudit(w io.Writer, diffs []diffx.FileDiff, toolVersion string, ...) error
- func SortQueue(rows []QueueRow)
- func Terminal(w io.Writer, diffs []diffx.FileDiff, sum diffx.Summary, color bool, ...)
- type QueueRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditMarkdown ¶ added in v0.4.0
func AuditMarkdown(w io.Writer, diffs []diffx.FileDiff, sum diffx.Summary, vulnsChecked, metaChecked bool, freshDays int)
AuditMarkdown renders an audit report suited for issues, PR comments, or pasting into a chat.
func AuditTerminal ¶ added in v0.4.0
func AuditTerminal(w io.Writer, diffs []diffx.FileDiff, sum diffx.Summary, color, vulnsChecked, metaChecked bool, freshDays int)
AuditTerminal renders an audit for the terminal: per lockfile, only the packages with findings, then a one-line summary.
func Markdown ¶
func Markdown(w io.Writer, diffs []diffx.FileDiff, sum diffx.Summary, vulnsChecked, metaChecked bool, freshDays int)
Markdown writes a report suited for PR comments.
func QueueMarkdown ¶ added in v0.1.13
func QueueMarkdown(w io.Writer, heading, noun string, rows []QueueRow, vulnsChecked, metaChecked bool, freshDays int)
QueueMarkdown renders the queue overview as a markdown table (for pasting into a triage issue or posting from CI).
func QueueTerminal ¶ added in v0.1.13
func QueueTerminal(w io.Writer, heading, noun, refHint string, rows []QueueRow, color, vulnsChecked, metaChecked bool, freshDays int)
QueueTerminal renders the queue overview table. noun is "PR" or "MR", matching the forge the queue came from.
func SARIF ¶ added in v0.1.12
func SARIF(w io.Writer, diffs []diffx.FileDiff, toolVersion string, contents func(path string) []byte) error
SARIF writes the diff as a SARIF 2.1.0 log suitable for GitHub Code Scanning (and any other SARIF consumer). Findings:
- a vulnerability introduced by an incoming version → error/warning
- a known vulnerability the change still doesn't fix → note
- an incoming version its own registry marks deprecated → warning
contents, when non-nil, returns the new-side bytes of a lockfile path so results can point at the exact line that names the package; without it (or when the package isn't found) results point at line 1.
func SARIFAudit ¶ added in v0.4.0
func SARIFAudit(w io.Writer, diffs []diffx.FileDiff, toolVersion string, contents func(path string) []byte) error
SARIFAudit is SARIF for `lockvet audit`, where every package is reported against the current pin rather than a change ("is pinned at", not "was added at").
Types ¶
type QueueRow ¶ added in v0.1.13
type QueueRow struct {
Label string // e.g. "cli#9793" or "#123"
URL string
Title string
Author string
Sum diffx.Summary
// NoChanges: the PR touches no lockfiles (or no semantic changes).
NoChanges bool
// NoChangesMsg overrides the "no lockfile changes" label (e.g. when
// an -only filter removed everything).
NoChangesMsg string
Err string // fetch/parse failure; row shows the error instead
}
QueueRow is one pull request in a dependency-update queue overview.