Git pre-commit hook for checking CFEngine 3 syntax

I was inspired by William Orr’s svn com­mit hook and looked up the magic needed to flesh out the git pre-commit hook I sub­mit­ted to the Design Cen­ter a while back.

Now the index is checked out to its own tem­po­rary direc­tory and cf-promises val­i­dates promises.cf and failsafe.cf before allow­ing the com­mit to pro­ceed. Now you won’t get syn­tax errors if you have for­got­ten to add a new pol­icy file to the index but its already included in your body com­mon con­trol inputs list. If your using a gen­er­ated inputs list then you might want to add a sep­a­rate file that includes every­thing for syn­tax checks. Be sure to include that file in the check­files list.

I would like to see a pre-receive ver­sion of this some day.

No Comments

Leave a Reply

Your email is never shared.Required fields are marked *

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha