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.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.
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
- Web UI
.coderabbit.yaml
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.
config_file is not set, CodeRabbit looks for these SQLFluff config files:
setup.cfgtox.inipep8.ini.sqlfluffpyproject.toml
[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, andNULLcomparisons with=or!=. - Assertive uses a broader semantic and structural rule set, including checks for unused aliases or CTEs, duplicate aliases, identifier portability, unnecessary
CASEexpressions, misleadingDISTINCTsyntax, 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
.sqlfiles. - SQLFluff is already running in GitHub workflows.
Ignored codes
The following SQLFluff codes are automatically ignored:| Code | Description |
|---|---|
LT01 | Trailing whitespace |
LT02 | Indentation |
CP01 | Keyword capitalization |
CP02 | Identifier capitalization |
CP03 | Function name capitalization |
CV06 | Convention style checks |
RF02 | Qualified reference style |
RF06 | Reference style checks |
LXR | Lexing stage failures |
PRS | Parsing stage failures |
TMP | Templating 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.