sqlstyle.guide
sqlstyle.guide copied to clipboard
Add list of linters / editor plugins implementing the styleguide to the readme
Hi, I'm creating this issue as a follow-up to a question on twitter. The idea is to be able to follow this issue to be notified, when there are plugins/linters available.
Ideas for implementation:
- Eslint plugin like gajus/eslint-plugin-sql
- php-cs-fixer plugin
- standalone linter like sqllint
Following
I would also like to know if someone has tried to build an auto-formatter/prettifier based on this style guide?
I would prefer to go with a standalone option that could be integrated by others into tool specific wrappers like plugins for eslint, etc. This way it can be used by more people across varied build architectures.
This is the closest I have seen so far. It is from the CockroachDB labs by @mjibson - an example of the SQL output compared to a query specified in the style guide: example on sqlfum.pt
It also comes as a standalone go binary as well; that can be configured to format SQL on save in an editor etc.
There was some limited discussion on making it compatible with the sqlstyle.guide on Twitter: https://twitter.com/mjibson/status/1118234708117266433 but this doesn't appear to have been completed.
The code is available over at https://github.com/mjibson/sqlfmt
I will pay a bounty to whoever implements a command line standalone formatter/linter that adheres to this guide.
I have not looked closely yet, but perhaps SQLFluff might work too.