Add a sql linter to pre-commit
Feature Request
Problem / Opportunity
We had a ~1y period where new folks trying to initialize the open library repo likely couldn't because of syntax error (missing semicolon 🙃 ) in our .sql files. Having a basic sql linter run in pre-commit would help prevent issues like these. Note since the postgres container caches its initialization logic, no one who regularly develops OL saw this issue.
See https://github.com/internetarchive/openlibrary/pull/10979
Proposal
sqlfluff seems like an option: https://docs.sqlfluff.com/en/latest/production/pre_commit.html
Breakdown
Related files
Refer to this map of common Endpoints: *
Requirements Checklist
Checklist of requirements that need to be satisfied in order for this issue to be closed:
- [ ]
Stakeholders
Instructions for Contributors
- Before creating a new branch or pushing up changes to a PR, please first run these commands to ensure your repository is up to date, as the pre-commit bot may add commits to your PRs upstream.
I am a new contributor and I would like to help with this issue. Could you please assign it to me?