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

CLI Reference

squint [OPTIONS] [FILES]...

Files and directories can be mixed as positional arguments. Directories are walked recursively for *.sql files, respecting .gitignore.

Options

FlagDescription
--fixRewrite files in place, applying all auto-fixable violations. Remaining violations are reported after fixing. Cannot be combined with --check.
--checkExit 1 if any file would be changed by --fix, without writing. Standard CI gate. Cannot be combined with --fix.
--rules <IDs>Comma-separated rule IDs to run, e.g. CP01,LT05. Runs all rules by default.
--max-line-length <N>Override the LT05 line length limit. Equivalent to [rules.LT05] max_line_length = N in config.
-q, --quietShow only the violation count per file, not individual violations.
--format <fmt>Output format: text (default) or json.
--output <file>Write violations to a file in addition to stdout.
--exclude <pattern>Glob pattern to exclude (repeatable). Merged with the exclude list in config.
--stdin-filename <NAME>Read SQL from stdin and report violations under this filename. Cannot be combined with positional file arguments.
--versionPrint version and exit.
-h, --helpPrint help and exit.

Exit codes

CodeMeaning
0No error-severity violations (warnings are allowed)
1One or more error-severity violations; or --check detected drift
2I/O error (file not found, permission denied, etc.)

Output format

Text (default)

path/to/file.sql:LINE:COL: [SEVERITY] [RULE_ID] message

Example:

models/stg_orders.sql:3:1: [error] [CP01] Expected lowercase keyword, got 'SELECT'
models/stg_orders.sql:5:45: [warning] [LT05] Line too long (143 > 120 characters)

Found 1 error and 1 warning in 1 file.

JSON (--format json)

See JSON Output.

Environment

The linter reads squint.toml by walking up from the current working directory. CLI flags always override config file values.