Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

JSON Output

Use --format json to get machine-readable output. Useful for CI dashboards, editor plugins, SARIF converters, and scripts.

squint --format json models/

Shape

A JSON array — one object per file processed (including files with zero violations):

[
  {
    "path": "models/staging/stg_orders.sql",
    "violations": [
      {
        "line": 3,
        "col": 1,
        "rule_id": "CP01",
        "message": "Expected lowercase keyword, got 'SELECT'",
        "severity": "error"
      },
      {
        "line": 5,
        "col": 45,
        "rule_id": "LT05",
        "message": "Line too long (143 > 120 characters)",
        "severity": "warning"
      }
    ],
    "fixed": false
  },
  {
    "path": "models/staging/stg_customers.sql",
    "violations": [],
    "fixed": false
  }
]

Fields

FieldTypeDescription
pathstringFile path as given on the command line or walked from a directory
violationsarrayList of violations; empty array if the file is clean
violations[].lineinteger1-based line number
violations[].colinteger1-based column number
violations[].rule_idstringRule ID, e.g. "CP01"
violations[].messagestringHuman-readable violation message
violations[].severitystring"error" or "warning"
fixedbooleantrue if --fix was passed and the file was modified

Combined with –fix

squint --fix --format json models/

"fixed": true is set for files that were rewritten. Violations in the output are the remaining violations after fixing (unfixable rules that still triggered).

Piping to jq

# Count total violations
squint --format json models/ | jq '[.[].violations | length] | add'

# Show only errors
squint --format json models/ | jq '
  [.[] | select(.violations | length > 0) | {
    path,
    errors: [.violations[] | select(.severity == "error")]
  } | select(.errors | length > 0)]
'

# Files with violations
squint --format json models/ | jq '.[] | select(.violations | length > 0) | .path'