dbt testing & code quality · SQLFluff (open source project)

SQLFluff

Open-source SQL linter and auto-formatter with a dedicated templater for dbt projects across multiple SQL dialects.

SQLFluff is a dialect-flexible SQL linter and auto-formatter that understands Jinja templating, which makes it usable directly against dbt models rather than only against plain SQL. Its dbt templater, maintained in the same repository, resolves ref() and macro calls before linting so rules are checked against the SQL a warehouse would actually run, and most rule violations can be auto-fixed rather than only flagged. It is run from the command line, in CI, or from an editor plugin, and is the linter used inside dbt Cloud's Studio IDE. As a pure linter and formatter, SQLFluff checks style and structural consistency, not data correctness, so teams typically pair it with a data-testing tool like Recce or Datafold for full quality coverage. It is free, MIT-licensed and self-hosted by nature since it runs wherever the project's code does.

At a glance

Vendor SQLFluff (open source project)
Pricing model Open source + paid options
Free tier Yes
Deployment Self-hosted
Open source Yes (MIT)
Best for Analytics engineering teams wanting consistent, auto-fixable SQL style enforcement across a dbt codebase.

Pricing

Free, open-source CLI tool; no paid tiers.

Pricing has not been verified yet — see the vendor's site.

Features

  • Configurable SQL linting across multiple dialects
  • Auto-fix for most rule violations
  • Dedicated dbt templater resolving ref() and macros before linting
  • CI and pre-commit integration
  • Used as the built-in linter in dbt Cloud's Studio IDE
  • Editor plugins for VS Code and others

Integrations

Profile last reviewed September 21, 2026

Head to head

Alternatives

SQLFluff in the index now

Terms to know

Related guides