Skip to main content


You can use Trunk to integrate sqlfmt into VSCode, GitHub Actions, and your local development workflow.


curl -fsSL | bash
trunk init
trunk check enable sqlfmt


You can install the VSCode extension here, which will not only flag formatting issues for you

Screenshot of Trunk showing a sqlfmt issue in VSCode

but also allow you to use Trunk to format-on-save SQL files with sqlfmt:

"editor.defaultFormatter": ""
"editor.formatOnSave": true,

GitHub Actions

Trunk provides a GitHub Action that will highlight lint and formatting issues for you, including sqlfmt issues.

Screenshot of Trunk showing a sqlfmt issue in GitHub

Here's an example workflow that you can use:

name: Pull Request
on: [pull_request, workflow_dispatch]
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

name: Trunk Check Runner
runs-on: ubuntu-latest

- name: Checkout
uses: actions/checkout@v3

- name: Trunk Check
uses: trunk-io/trunk-action@v1

Learn more

More information can be found in Trunk's documentation.