cachix / git-hooks.nix

Seamless integration of https://pre-commit.com git hooks with Nix.
Apache License 2.0
531 stars 155 forks source link

Usage with other types of custom hooks #260

Open Alexnortung opened 1 year ago

Alexnortung commented 1 year ago

First off I want to say that I really like this project!

I know the name of the project is pre-commit-hooks, however I would like to be able to install other types of hooks for our workflow in our team. I would hope that this project would be able to help install these hooks in a nice and declarative manner.

I did take a quick look at the source code, but I am not sure where to begin if I should contribute this kind of feature.

Alexnortung commented 1 year ago

To clarify: by other hooks i mean post-commit hooks, pre-merge-commit, etc.

For context, our team are developing with Strapi and are using source controlled files to sync our development and production configurations. We are currently exporting our changed configs with a pre-commit hook, but this raises problems when merging, since the export function will now override what was in the merge. So we would need to use a git pre-merge hook to import what is in the source control.

domenkozar commented 7 months ago

That's supported, maybe we should rename the project to git-hooks.nix

Alexnortung commented 7 months ago

Is it already supported in this project? How can it be used? Or do you mean it can be supported by this project? :)

domenkozar commented 7 months ago

See https://devenv.sh/reference/options/#pre-commitdefault_stages

Alexnortung commented 7 months ago

Thanks a lot, this solved my issue :)