Skip to content

sqruff Configurations

Tip

Official documentation for sqruff is available at https://github.com/quarylabs/sqruff

.sqruff
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
[sqruff]
dialect = bigquery
templater = jinja
sql_file_exts = .sql
max_line_length = 80
exclude_rules =
rules = all

[sqruff:indentation]
indent_unit = space
tab_space_size = 2
indented_joins = True

[sqruff:rules:ambiguous.join]
fully_qualify_join_types = both

Configuration Options

  • dialect: SQL dialect (BigQuery)
  • templater: Jinja templates in SQL files are rendered before linting
  • max_line_length: 80 characters
  • rules: All rules are enabled; list rules to skip in exclude_rules
  • Indentation: 2 spaces, and JOIN clauses are indented
  • ambiguous.join: Join types must be written explicitly (e.g. INNER JOIN, not JOIN)

Files listed in .sqruffignore are skipped.

Usage

1
2
3
4
5
6
7
# Lint / format SQL files via nox
uv run nox -s lint -- --sqruff
uv run nox -s fmt -- --sqruff

# Run sqruff directly
uv run sqruff lint
uv run sqruff fix