Skip to content

adding sqlfluff #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/tools/sqlfluff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: SQLFluff
sidebar_label: SQLFluff
description: CodeRabbit's guide to SQLFluff.
---

```mdx-code-block
import ProPlanNotice from '@site/src/components/ProPlanNotice.mdx';

<ProPlanNotice />
```

[SQLFluff](https://github.com/sqlfluff/sqlfluff) is a SQL linter and auto-formatter for standardizing SQL code.

## Files

SQLFluff will run on files with the following extensions:

- `.sql`

## Configuration

SQLFluff supports the following config files:

- User-defined config file set at `reviews.tools.sqlfluff.config_file` in your project's `.coderabbit.yaml` file or setting the "Review → Tools → SQLFluff → Config File" field in CodeRabbit's settings page.
- `setup.cfg`
- `tox.ini`
- `pep8.ini`
- `.sqlfluff`
- `pyproject.toml`

:::note

CodeRabbit will only run SQLFluff if your repository contains a SQLFluff config file. This config must use one of the default file names listed above, or you must define the path to this file in the `.coderabbit.yaml` or config UI.

:::

## Links

- [SQLFluff Configuration](https://docs.sqlfluff.com/en/stable/configuration.html)
- [SQLFluff Rules Reference](https://docs.sqlfluff.com/en/stable/rules.html)
2 changes: 2 additions & 0 deletions docs/tools/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ Remove extraneous f prefix
| Ruby | [RuboCop][RuboCop] | Code Quality |
| Semgrep | [Semgrep][Semgrep] | Code Security |
| Shell (sh, bash, ksh, dash) | [ShellCheck][ShellCheck] | Code Quality |
| SQL | [SQLFluff][SQLFluff] | Code Quality |
| Swift | [SwiftLint][SwiftLint] | Code Quality |
| Terraform | [Checkov][Checkov] | Code Security |
| TSX | [Biome][Biome] | Code Quality |
| Typescript | [Biome][Biome] | Code Quality |
| YAML | [YAMLlint][YAMLlint] | Code Quality |

[ShellCheck]: ./shellcheck.md
[SQLFluff]: ./sqlfluff.md
[Ruff]: ./ruff.md
[markdownlint]: ./markdownlint.md
[LanguageTool]: ./languagetool.md
Expand Down