copywrite icon indicating copy to clipboard operation
copywrite copied to clipboard

fix(pre-commit): Hooks should use the copywrite binary

Open bhundven opened this issue 1 year ago • 1 comments

If you use copywrite in your repo, you probably already have copywrite installed.

The hooks running go run . doesn't work in my terraform provider, because it is a plugin:

This binary is a plugin. These are not meant to be executed directly.
Please execute the program that consumes these plugins, which will
load any plugins automatically
exit status 1

So switch the entry point to be the copywrite program. Don't pass filenames. copywrite knows what to do.

Pass arguments directly on the entry.

Closes #78

bhundven avatar Feb 22 '25 03:02 bhundven

I'm happy to drop the additional_dependencies commit. It's why I made it a second commit.

bhundven avatar Feb 22 '25 06:02 bhundven

Could someone take a look at this ? Copywrite is currently unusable as pre-commit hook without this fix...

Also, @bhundven, the additional commit you made breaks pre-commit ci (see image below), idk if this is expected and something is required on my end.

Image

image

Paillat-dev avatar May 27 '25 18:05 Paillat-dev

Also, @bhundven, the additional commit you made breaks pre-commit ci (see image below), idk if this is expected and something is required on my end.

@Paillat-dev I have removed the second commit. Thanks!

bhundven avatar Jun 08 '25 18:06 bhundven

https://github.com/hashicorp/copywrite/pull/123 is related, and should be reviewed/merged at the same time. If you would rather have one PR for both, I could also update this PR.

@CalebAlbers Sorry to call out, but could we get a review of these? Massive thank you in advance!

bhundven avatar Jun 08 '25 18:06 bhundven

@mukeshjc Could you please review this. Thank you.

mallikabandaru avatar Jun 09 '25 07:06 mallikabandaru

Thanks for looking into this 🚀

sonamtenzin2 avatar Sep 30 '25 07:09 sonamtenzin2