- Run `sqlfluff lint --dialect postgres sql/` in CI and fail on any `L0` or `L1` severity violation — treat SQL lint errors the same as application code lint errors.
- Run `sqlfluff fix --dialect postgres sql/` to auto-correct whitespace, capitalization, and trailing comma placement without manual editing.
- Configure `.sqlfluff` with `[sqlfluff]` section specifying `dialect`, `templater`, and `max_line_length` — commit this file to enforce consistent settings across all contributors.
- Enable `L028` (references must be qualified) and `L031` (avoid table aliases for single-table queries) to catch ambiguous column references early.
- Use SQLFluff with the `dbt` templater when linting dbt models: set `templater = dbt` in `.sqlfluff` so `{{ ref() }}` and `{{ source() }}` macros resolve correctly.
- Suppress individual rules inline only with `-- noqa: L010` and add a comment explaining why the suppression is intentional.
- Set `sql_file_exts = .sql,.hql,.ddl` in `.sqlfluff` to lint all SQL variant file extensions in the project.