Skip to main content

Module sarif

Module sarif 

Source
Available on crate feature sarif only.
Expand description

SARIF 2.1.0 export for Report and MultiReport.

Maps fail-verdict and warn-verdict CheckResults to SARIF results. Pass and skip checks are intentionally NOT emitted — SARIF is a defect report format, not a test-result format. Use crate::junit (or the native JSON schema) when you need every check.

Severity → SARIF level:

SeveritySARIF level
Critical, Errorerror
Warningwarning
Infonote
None (unreachable for fail/warn)none

Evidence payloads of kind EvidenceData::FileRef become SARIF physicalLocation entries with region.startLine / region.endLine when the FileRef carries a line range.

For a MultiReport, each constituent Report becomes a separate SARIF run, so consumers can tell which producer emitted which finding.

Available with the sarif feature.

Functions§

multi_to_sarif
Render multi as a SARIF 2.1.0 document with one run per constituent Report.
to_sarif
Render report as a SARIF 2.1.0 document.