-
Notifications
You must be signed in to change notification settings - Fork 37
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
Support system-installed yamlfmt #144
Comments
Is there an example of a hook, either here or in some other source that has the pattern of support you want? You can make system-installed yamlfmt work with a locally defined
Maybe there is a way for a See #58 for the discussion from when I added pre-commit support. |
Here's the terraform-docs pre-commit hook, which supports 3 different methods of using/installing the binary: https://github.com/terraform-docs/terraform-docs/blob/master/.pre-commit-hooks.yaml I understand I can create the hook myself, but it's always good to just source to your hook definition and just configure it locally. |
I remembered the reason I didn't do this at the time. I wanted to submit it to the Best thing to do to get this functionality would probably be to host another repo to store a
Most likely that should be all that's required, given how the |
Okay. By the way, @braydonk, this is the error I get today (I'm on Go 1.21):
|
@braydonk I submitted a PR. Normally, the ID of the Go hook must have been |
The I will open an issue in the pre commit dot com repo and ask if they will still accept a hook in their list if one of the hooks is |
pre-commit/pre-commit.com#888 confirms that I will not remain on the I will be closing this issue since I now know for sure that adding a |
You're wrong! First, you say you're not using pre-commit, but we do! Many hooks listed there also come with system language like |
https://github.com/terraform-docs/terraform-docs/blob/master/.pre-commit-hooks.yaml is not in https://pre-commit.com/hooks.html, which is the list that I am referring to. The maintainer of pre-commit has told me in pre-commit/pre-commit.com#888 that |
@braydonk Okay, my bad. The PR template also bans scripts, but the mentioned And, honestly, which is more important to you: a) DX of your users or being listed in some repo nobody really cares about, which only serves vanity and has almost zero practical or marketing value?! |
My understanding is that list is designed to be a list of supported hooks particularly for folks using I tried the following to use the existing hook as a system hook:
a:
b: 1 # one space indent will be changed to 2 by default
As a result I was able to successfully use the |
@braydonk Thanks! I didn't know it could be overridden. I didn't spend much time and only quickly browsed the hooks I've been using personally, but if I find a decent amount of other Git hooks in that official list, using |
What does the additional hook get you that the override doesn't? |
@braydonk Let's be honest here - it's a hack. |
I think it's a pretty reasonable solution. The only thing that actually changes between a |
There is no need for the Go compiler to use a YAML formatting hook! Your tool could have already been installed in the system using various means. support
-system
like many other hooks.The text was updated successfully, but these errors were encountered: