sarif

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sarif renders test and coverage results into SARIF 2.1.0 format, which GitHub Advanced Security can ingest and display as code scanning alerts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderCov

func RenderCov(w io.Writer, rep *covmodel.CovReport, threshold float64, toolVersion string) error

RenderCov writes a SARIF 2.1.0 document for coverage results to w.

When threshold > 0, every file whose line coverage is below the threshold is emitted as a SARIF result with level "warning". A threshold of 0 means no threshold is enforced; an empty results array is still produced so that a previous upload's alerts are cleared by GitHub Advanced Security.

toolVersion is embedded in the tool.driver block.

func RenderTest

func RenderTest(w io.Writer, rep *model.Report, toolVersion string) error

RenderTest writes a SARIF 2.1.0 document for failed test cases to w. Each failing test case becomes one SARIF result with level "error". Passing and skipped tests are omitted; SARIF alerts are problem-only. toolVersion is embedded in the tool.driver block (pass the build version string).

Types

This section is empty.

Jump to

Keyboard shortcuts

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