{
  "id": 22628832,
  "title": "Enforce SQL Formatting with pre-commit and GitHub Actions",
  "url": "https://urgent.news/2026/11/29/enforce-sql-formatting-with-pre-commit-and-github-actions",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-29T17:59:51.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/andrewll/enforce-sql-formatting-with-pre-commit-and-github-actions-1ehp"
  },
  "original_language": null,
  "account": "Enforcing consistent SQL formatting is crucial for maintaining code quality and reducing reviewer fatigue. A single bad habit quickly propagates, resulting in a variety of formatting styles across the codebase. Each developer's editor settings, such as space insertion, join alignment, and formatting tools, contribute to this drift. Pull requests often contain a mix of logical changes and whitespace alterations, causing reviewers to focus on formatting rather than correctness. Format-on-save settings are personal preferences, not team policies, leading to inconsistent formatting when multiple tools are used. To address this issue, a shared SQL formatting setup can be established using SQLFluff, pre-commit, and GitHub Actions. This solution separates formatting failures from lint failures and ensures consistent formatting across the team.",
  "summary": "SQL style drift rarely comes from one bad decision. It comes from a hundred small ones: one developer's editor inserts two spaces after SELECT , another aligns joins differently, and a third commits a query that was formatted by a tool nobody else has installed. The pull request then contains a mix of logic changes and whitespace churn, and reviewers spend their attention on spacing instead of…",
  "summary_source": "publisher",
  "key_points": [
    "Consistent SQL formatting crucial for code quality",
    "SQLFluff, pre-commit, and GitHub Actions solution",
    "Format failures separated from lint failures"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}