Skip to main content

Reporters

The validator writes results to stdout by default. Use --reporter to control the format, --groupby to organize results, and --quiet to suppress output entirely.

Reporter types

ReporterDescriptionUse case
standardHuman-readable table (default)Terminal use, local development
jsonStructured JSONCI pipelines, scripting, programmatic consumption
junitJUnit XMLJenkins, GitLab CI, any system that reads JUnit reports
sarifSARIF 2.1.0GitHub Code Scanning, VS Code SARIF Viewer

Basic usage

validator --reporter=json .

Output to a file

Append :<path> to the reporter name to write results to a file:

validator --reporter=json:output.json .

Repeat the same reporter type with different paths to write the same format to more than one file:

validator --reporter=json:summary.json --reporter=json:artifacts/summary.json .

Use :- to explicitly direct output to stdout (useful when combining reporters):

validator --reporter=json:- --reporter=junit:results.xml .

Multiple reporters

Chain --reporter flags to produce multiple outputs in a single run:

validator --reporter=standard --reporter=json:output.json .
validator --reporter=junit:results.xml --reporter=sarif:results.sarif .

In .cfv.toml:

reporter = ["standard", "json:output.json"]

Grouping output

note

Grouping only applies to the standard and json reporters.

Use --groupby to organize the report. Supported groupings:

ValueGroups by
filetypeFile format (JSON, YAML, TOML, etc.)
directoryParent directory
pass-failValidation result
error-typeType of error (syntax, schema)

Combine multiple groupings:

validator --groupby=filetype,pass-fail .

In .cfv.toml:

groupby = ["filetype", "pass-fail"]

Reporters

JSON

The JSON reporter produces an array of result objects:

[
{
"file": "/path/to/config.yaml",
"status": "pass",
"message": ""
},
{
"file": "/path/to/broken.json",
"status": "fail",
"message": "unexpected EOF"
}
]

SARIF

The SARIF reporter produces a SARIF 2.1.0 log. This integrates with:

  • GitHub Code Scanning — upload with github/codeql-action/upload-sarif
  • VS Code — view with the SARIF Viewer extension
  • Azure DevOps — native SARIF support in pipeline results

Example GitHub Actions step:

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
if: always()

JUnit

The JUnit reporter produces XML compatible with CI systems that consume JUnit test reports. Each validated file appears as a test case; failures include the error message.