yuvipanda / pre-commit-hook-ensure-sops

pre-commit hook to ensure that files that should be encrypted with sops are
BSD 3-Clause "New" or "Revised" License
35 stars 19 forks source link

Declare stages for when the hook is relevant #2

Open consideRatio opened 2 years ago

consideRatio commented 2 years ago

I suspect not all git hook stages are relevant for this hook, so we should scope it to just those of relevance so its not run for no reason when it doesn't have to be. See https://pre-commit.com/#creating-new-hooks and the stages part.

PS: Adding a link to a related configuration reference for files like .pre-commit-hooks.yaml at the top of the file is a practice I really love, then anyone can quickly just visit the configuration reference and learn more about the kind of things that can make sense to do in a file. In this case, https://pre-commit.com/#creating-new-hooks is the relevant reference link for .pre-commit-hooks.yaml

yuvipanda commented 2 years ago

I'm guessing it's just the commit stage?

consideRatio commented 2 years ago

@yuvipanda I think you are right - only commit (which is pre-commit).