report

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package report renders scan results for terminals and machines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w io.Writer, results []scan.Result, o Options) error

JSON writes results as one JSON document. Token values are redacted unless ShowSecrets is set.

func Plural added in v0.2.0

func Plural(n int, one, many string) string

Plural picks the singular or plural form for n.

func Refs

func Refs(refs []string, limit int) string

Refs renders ref names compactly: branches by name (default branches first), tags as "tag v1", pull request refs as "PR #12", at most limit entries; limit 0 means all of them.

func StatusLine

func StatusLine(r scan.Result, o Options) string

StatusLine renders the one-line outcome for a target as it completes.

func Text

func Text(w io.Writer, results []scan.Result, o Options)

Text writes the final report: every distinct token with all the places it was found, followed by a summary line.

Types

type Options

type Options struct {
	Color       bool
	ShowSecrets bool
	// AllRefs lists every ref a commit is on instead of the first few.
	AllRefs bool
}

Options control text rendering.

type Output

type Output struct {
	Summary summary       `json:"summary"`
	Results []scan.Result `json:"results"`
}

Output is the JSON document written by JSON.

type Step added in v0.2.0

type Step struct {
	Label string
	Text  string
}

Step is one line of advice under a finding.

func Remediation added in v0.2.0

func Remediation(f scan.Finding) []Step

Remediation says what to do about a token: how to revoke it, where it is still configured on this machine, and what its history needs. A token GitHub already rejects needs nothing.

Jump to

Keyboard shortcuts

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