Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure sqlfluff to auto-format SQL files #1702

Open
nyurik opened this issue Feb 23, 2025 · 0 comments
Open

Configure sqlfluff to auto-format SQL files #1702

nyurik opened this issue Feb 23, 2025 · 0 comments
Labels

Comments

@nyurik
Copy link
Member

nyurik commented Feb 23, 2025

Something like this should be added to the root .pre-commit-config.yaml file to configure sqlfluff.

This needs a more thorough configuration, e.g. maybe different spacing, alignment, capitalization, and other settings. We might need to create a dedicated .sqlfluff file with all these settings.

   - repo: https://github.com/sqlfluff/sqlfluff
     rev: 3.3.1
     hooks:
       - id: sqlfluff-fix
         name: sqlfluff-fix
         args: [ "--dialect", "postgres" ]
         files: '^.*\.sql$'
@nyurik nyurik added ci/cd enhancement github_actions Pull requests that update GitHub Actions code good first issue help wanted labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant