Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt

Use this file to discover all available pages before exploring further.

SQLFluff is a dialect-flexible SQL linter for standardizing SQL code. CodeRabbit runs SQLFluff version 4.2.1 in a secure sandbox and reports lint findings on changed SQL files.

Files

SQLFluff runs on files with the .sql extension.

Configuration

To enable or disable SQLFluff, use your .coderabbit.yaml file or the CodeRabbit web UI:
.coderabbit.yaml
reviews:
  tools:
    sqlfluff:
      enabled: true
      config_file: "custom/.sqlfluff"
SQLFluff supports the following configuration option:
  • config_file (default: unset): Optional path to a SQLFluff configuration file relative to the repository. Use this when the config file is not named one of SQLFluff’s default filenames.
When config_file is not set, CodeRabbit looks for these SQLFluff config files:
  • setup.cfg
  • tox.ini
  • pep8.ini
  • .sqlfluff
  • pyproject.toml
CodeRabbit uses a SQLFluff config file only when it contains a [sqlfluff] or [tool.sqlfluff] section. If no valid SQLFluff config file is found, CodeRabbit writes a temporary config based on the selected review profile and detected SQL dialect.

Profile behavior

When no valid SQLFluff config file is found, CodeRabbit generates a temporary config whose rule set depends on the active review profile:
  • Chill uses a narrow default rule set focused on SQL issues that can cause incorrect results or runtime failures, including bare UNION, mismatched set-operation column counts, implicit cross joins, duplicate table aliases, and NULL comparisons with = or !=.
  • Assertive uses a broader semantic and structural rule set, including checks for unused aliases or CTEs, duplicate aliases, identifier portability, unnecessary CASE expressions, misleading DISTINCT syntax, unreferenced joined tables, and T-SQL procedure issues. Layout, capitalization, style-preference, and high-noise reference rules remain excluded.

Security policy and restrictions

SQLFluff runs in a secure sandbox using CodeRabbit’s installed SQLFluff package. CodeRabbit does not install repository-provided Python packages, custom SQLFluff plugins, or custom templaters for this integration.
Custom plugins and templaters that require repository-provided Python packages are not supported.

When CodeRabbit skips SQLFluff

CodeRabbit skips SQLFluff when:
  • SQLFluff is disabled in CodeRabbit settings.
  • The pull request does not include changed .sql files.
  • SQLFluff is already running in GitHub workflows.

Ignored codes

The following SQLFluff codes are automatically ignored:
CodeDescription
LT01Trailing whitespace
LT02Indentation
CP01Keyword capitalization
CP02Identifier capitalization
CP03Function name capitalization
CV06Convention style checks
RF02Qualified reference style
RF06Reference style checks
LXRLexing stage failures
PRSParsing stage failures
TMPTemplating stage failures

What’s next

All supported tools

Browse the complete list of linters, security analyzers, and CI/CD integrations available in CodeRabbit.

Tools reference

Explore detailed specifications and capabilities of all available CodeRabbit tools.

Configuration reference

Full reference for all available options, including how to enable, disable, and tune individual tools.