SARIF Output

SARIF 2.1.0 output for deterministic accessibility and layout findings.

One emitter shared by the axe-core and layout paths, so layoutlens page.html --a11y axe --output sarif and layoutlens page.html --layout deterministic --output sarif both plug straight into GitHub Code Scanning (upload with github/codeql-action/upload-sarif), where findings appear as annotations with stable rule ids and over-time tracking.

Only deterministic findings are emitted: they carry a rule id, a selector, and measured numbers. LLM verdicts have none of those and do not belong in a static-analysis report.

layoutlens.sarif.to_sarif(results)[source]

Build a SARIF 2.1.0 log from deterministic analysis results.

Parameters:

results (list[AnalysisResult]) – Analysis results whose metadata may carry an "a11y" (axe report) and/or "layout" (layout report) block.

Returns:

A SARIF log dict, ready for json.dumps.

Return type:

dict[str, Any]