0PricingLogin
SQL Academy · Lesson

SQLFluff and Linting

Lint SQL with SQLFluff, enforce a house style, and auto-fix common formatting issues.

Why Lint SQL?

SQL is hand-written, easy to format inconsistently. Linting enforces a house style automatically:

  • Lower vs UPPER keywords
  • Comma at end vs start of line
  • Naming conventions for tables, columns
  • Indentation
  • Anti-patterns (SELECT *, ambiguous joins, etc.)

SQLFluff: The De Facto Linter

Open source, dialect-aware, supports many SQL flavors and works great with dbt:

pip install sqlfluff

sqlfluff lint models/
sqlfluff fix models/   # auto-fix where safe

All lessons in this course

  1. DBT (Data Build Tool) Fundamentals
  2. SQLFluff and Linting
  3. Testing SQL: dbt tests, Great Expectations
  4. CI for Schema Changes (GitHub Actions)
← Back to SQL Academy