report

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package report renders engine findings as text or JSON.

Index

Constants

View Source
const CommentMarker = "<!-- bumper -->"

CommentMarker is the hidden HTML marker that lets the PR-comment surface find and update its previous comment in place rather than posting a new one.

Variables

View Source
var Version = "0.1.0"

Version is the tool version embedded in SARIF output.

Functions

func DepsJSON added in v1.2.0

func DepsJSON(w io.Writer, res *deps.ScanResult) error

DepsJSON writes the raw scan result as indented JSON (for agents / further tooling).

func DepsMarkdown added in v1.2.0

func DepsMarkdown(w io.Writer, res *deps.ScanResult)

DepsMarkdown writes a sticky-PR-comment summary (its own marker, so it coexists with the terraform comment).

func DepsSARIF added in v1.2.0

func DepsSARIF(w io.Writer, res *deps.ScanResult, artifactURI string) error

DepsSARIF writes the scan as a SARIF 2.1.0 log GitHub code scanning ingests; each CVE/MAL id is a rule, each affected package an attributed result.

func DepsText added in v1.2.0

func DepsText(w io.Writer, res *deps.ScanResult, label string)

DepsText prints a human-readable, severity-sorted dependency scan summary.

func FilterDepsSeverity added in v1.2.0

func FilterDepsSeverity(res *deps.ScanResult, min string) *deps.ScanResult

FilterDepsSeverity returns a copy keeping only vulns at or above min severity; malicious packages are always kept (treated as critical). Recomputes counts.

func JSON

func JSON(w io.Writer, findings []engine.Finding) error

JSON writes findings as an indented JSON array.

func Markdown

func Markdown(w io.Writer, findings []engine.Finding)

Markdown writes a PR-comment body: a hidden marker (so the comment can be updated in place), a severity summary, the critical/high findings inline, and the full list in a collapsible section.

func RuleDetail

func RuleDetail(w io.Writer, r *rules.Rule)

RuleDetail prints one rule, including its CEL check (the spec's "reproducible, explainable" pillar — you can see exactly what fires).

func RuleList

func RuleList(w io.Writer, rs []*rules.Rule, format string) error

RuleList renders a rule set as an aligned text table or JSON. The text table is colored on a terminal: severity by its color, the id in bold, source/resource dimmed. Columns are padded as plain text first, then colored, so the ANSI codes (zero display width) never throw off the alignment.

func SARIF

func SARIF(w io.Writer, findings []engine.Finding, artifactURI string) error

SARIF writes findings as a SARIF 2.1.0 log that GitHub code scanning ingests. artifactURI is the file the results are attributed to (the plan file).

func Text

func Text(w io.Writer, findings []engine.Finding)

Text writes a human-readable report — colored on a terminal, plain when piped. Layout mirrors the web app's --explain terminal: a colored severity token, the resource, the message, then labeled rule/fix/ref rows, with a severity tally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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