From f054835cd1f58d49577a007d6841db248b7b31fc Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Tue, 19 Mar 2013 23:33:36 -0400 Subject: [PATCH] DEV: Provides an example pre-commit hook. This pre-commit hook can be activated by copying or symlinking to the .git/hooks directory This particular commit hook is best suited for git versions < 1.8.2 The running of nosetests would be better suited for a push hook, but those are not added until 1.8.2. --- etc/git-hooks/pre-commit | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 etc/git-hooks/pre-commit diff --git a/etc/git-hooks/pre-commit b/etc/git-hooks/pre-commit new file mode 100755 index 00000000..83352197 --- /dev/null +++ b/etc/git-hooks/pre-commit @@ -0,0 +1,19 @@ +#!/bin/sh +# +# An hook script to verify linting and passing unit tests. +# +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, copy or symlink to your repo's +# ".git/hooks/pre-commit". +# +# Please read the following as it will execute on your machine on each commit. + +set -e + +# Run flake8 linting +flake8 zipline tests +# Run unit tests +nosetests -x