Commit & Push hooks
Been trying to workout my ideal process for using Git to automate my tests etc. Anything I’ve missed, or anything you would change?
Those marked with (B) will block the action from continuing if they fail. All others will show a message in the Terminal but let the user continue.
Commit Message
- Check message is in present tense
- If more than 6 files have modifications check for multiline commit message
Pre Commit
- (B) Is the author a generic account (admin, root, etc)?
Post Commit
- Do all Python files pass pep8?
- Do all Javascript files pass JSLint?
- Are there any “TODO:”s in the source?
Pre Push
- (B) Do all tests pass?
The pre-push will have to be a custom script which is aliased as “git push” as I don’t think it has a hook. Plus I would like a way of opting-out from running the tests on individual pushes.
So output would be something like:
Suggestions welcome :)