report

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package report renders engine findings as Markdown, JSON, or SARIF, and decides the process exit code from a --fail-on severity threshold.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(fs []engine.Finding) ([]byte, error)

JSON renders findings as an indented JSON array.

func Markdown

func Markdown(fs []engine.Finding, scopeDesc string) string

Markdown renders the findings report: one table per rule, ordered by severity then id, listing only fail and unknown rows. scopeDesc describes the run (e.g. "12 repos + org") for the summary line.

func SARIF

func SARIF(fs []engine.Finding) ([]byte, error)

SARIF renders fail and unknown findings as a SARIF 2.1.0 log, uploadable to GitHub code scanning and usable as an audit evidence artifact.

func ShouldFail

func ShouldFail(fs []engine.Finding, threshold string, failOnUnknown bool) bool

ShouldFail reports whether any finding fails at or above the threshold severity. threshold "none" never fails; "" defaults to "error". When failOnUnknown is set, an unknown finding at/above the threshold also fails — for the "the audit must be able to read everything" posture, so an under-scoped token can't slip a green build past the gate.

Types

type Counts

type Counts struct {
	Fail, Unknown, Pass int
}

Counts summarizes findings by status.

func Count

func Count(fs []engine.Finding) Counts

Jump to

Keyboard shortcuts

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