report

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package report formats scan results for humans (terminal table) and machines (SARIF). Output formats live here rather than in scan/ so the detector package stays focused on detection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SeverityRank

func SeverityRank(sev string) int

SeverityRank returns the ordinal for cmp purposes. Lower = more severe. Returns a high number for unknown severities so they sort last.

func Summary

func Summary(fs []scan.Finding, color bool) string

Summary returns a one-line counts breakdown — used by both the table output and CI mode's failure banner.

func WriteSARIF

func WriteSARIF(w io.Writer, findings []scan.Finding, toolVersion string) error

WriteSARIF serializes findings as a SARIF 2.1.0 log to w. The rules section is the set of unique (category, pattern) pairs seen in the findings — Code Scanning groups results by rule, so emitting a stable rule per pattern gives a cleaner dashboard.

func WriteTable

func WriteTable(w io.Writer, findings []scan.Finding)

WriteTable prints findings to w grouped by file, severity-sorted within each file. ANSI colors are enabled when out is a TTY; piped output stays plain so logs and `| less` don't get garbled escape codes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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