-
Notifications
You must be signed in to change notification settings - Fork 14
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
Create a pre-commit-hook for sqruff #742
Comments
Hi @benfdking and @gvozdvmozgu I have created a pre-commit hook here: https://github.com/concur1/sqruff-pre-commit I mainly tried to just copy the ruff pre-commit hook, but based it on cargo/rust instead of python/pypi as I thought that is more appropriate here. I was wondering if you would want to take ownership of this or if you would prefer to leave it with me? It works (from my testing at least) but there is one small thing that someone who knows more about rust might be able to help with: I have been forced to include a dummy/useless |
Why do we need to create a package? |
I presume we can just take the commit |
When people run pre-commit it will point to this repo and install sqruff for them based on the
I don't think that is possible with the current sqruff structure, we would need the root cargo.toml to create a sqruff binary, and ideally that would be all that it does. I will explain more below. I couldn't find any simimlar rust examples. From reading the pre-commit documentation and asking in their discord it seems that:
|
Pre commit hooks can be a useful development workflow that allow formatters/linters to run before a change is commited to git. There is a python pre-commit-hook utility that allows these to be configured with yaml. Here is an example of Ruff's pre-commit-hook: https://github.com/astral-sh/ruff-pre-commit
The text was updated successfully, but these errors were encountered: