Skip to main content

write_code_climate

Function write_code_climate 

Source
pub fn write_code_climate<W: Write>(
    offenders: &[OffenderRecord],
    writer: W,
) -> Result<()>
Expand description

Write a GitLab Code Climate JSON report for offenders to writer.

Offenders whose path is not valid UTF-8 — or whose repo-relative path collapses to the empty string after normalization — are skipped with a warning to stderr. The empty case emits the literal []\n so the artifact is always well-formed, even before the threshold engine produces any violations.

§Errors

Returns any io::Error produced by writer while emitting the JSON document, or a serde_json::Error (mapped to io::Error via io::Error::new) if a record cannot be serialised.