Skip to content

Command-Line Help for sqruff

This document contains the help content for the sqruff command-line program.

Command Overview:

sqruff

sqruff is a sql formatter and linter

Usage: sqruff [OPTIONS] <COMMAND>

Subcommands:
  • lint — Lint SQL files via passing a list of files or using stdin
  • fix — Fix SQL files via passing a list of files or using stdin
  • lsp — Run an LSP server
  • info — Print information about sqruff and the current environment
  • rules — Explain the available rules
  • dialects — List available dialects
  • templaters — List available templaters
  • parse — Parse SQL and output the concrete syntax tree (CST)
Options:
  • -n, --nocolor — Output without ANSI color codes
  • --color — Force color output, even when redirected or NO_COLOR is set
  • --config <CONFIG> — Additional configuration file whose settings override discovered configuration
  • --ignore-local-config — Ignore discovered global and project configuration files. Still load --config
  • --dialect <DIALECT> — Override the dialect (e.g., bigquery, clickhouse, ansi)
  • --library-path <LIBRARY_PATH> — Override the library_path value for the jinja templater. Set this to 'none' to disable it entirely. This overrides any values set by users in configuration files or inline directives
  • --stdin-filename <STDIN_FILENAME> — Load configuration for stdin as if it came from this file
  • --parsing-errors — Show parse errors

Default value: false * --disable-noqa-except <DISABLE_NOQA_EXCEPT> — Ignore all but the listed rules in inline noqa comments * --disable-noqa — Disable all inline noqa comments

Default value: false

sqruff lint

Lint SQL files via passing a list of files or using stdin

Usage: sqruff lint [OPTIONS] [PATHS]...

Arguments:
  • <PATHS> — Files or directories to fix. Use - to read from stdin
Options:
  • -q, --quiet — Suppress routine status output while preserving diagnostics and results
  • -v, --verbose — Show more detail about processed files. Repeat for higher verbosity
  • --disregard-sqruffignores [alias: disregard-sqlfluffignores] — Perform the operation regardless of .sqruffignore and .sqlfluffignore configurations
  • -f, --format <FORMAT>

Default value: human

Possible values: - human - github-annotation-native - gitlab - json - sarif - none: Produce no output. Used mostly for testing

  • --annotation-level <ANNOTATION_LEVEL> — Severity for GitLab Code Quality findings. Configured warnings remain info

Default value: warning

Possible values: notice, warning, failure, error

  • --write-output <PATH> — Write the GitLab Code Quality report to this file instead of stdout

sqruff fix

Fix SQL files via passing a list of files or using stdin

Usage: sqruff fix [OPTIONS] [PATHS]...

Arguments:
  • <PATHS> — Files or directories to fix. Use - to read from stdin
Options:
  • -q, --quiet — Suppress routine status output while preserving diagnostics and results
  • -v, --verbose — Show more detail about processed files. Repeat for higher verbosity
  • --disregard-sqruffignores [alias: disregard-sqlfluffignores] — Perform the operation regardless of .sqruffignore and .sqlfluffignore configurations
  • -f, --format <FORMAT> — The output format for the results

Default value: human

Possible values: - human - github-annotation-native - gitlab - json - sarif - none: Produce no output. Used mostly for testing

sqruff lsp

Run an LSP server

Usage: sqruff lsp

sqruff info

Print information about sqruff and the current environment

Usage: sqruff info

sqruff rules

Explain the available rules

Usage: sqruff rules

sqruff dialects

List available dialects

Usage: sqruff dialects

sqruff templaters

List available templaters

Usage: sqruff templaters

sqruff parse

Parse SQL and output the concrete syntax tree (CST)

Usage: sqruff parse [OPTIONS] [PATHS]...

Arguments:
  • <PATHS> — Files to parse. Use - or omit paths to read from stdin
Options:
  • -f, --format <FORMAT> — The output format for the parse tree

Default value: pretty

Possible values: - json - yaml - pretty - none: Produce no output. Used mostly for testing

  • --include-meta — Include meta segments and source position information in JSON or YAML output

This document was generated automatically by clap-markdown.