summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2011-08-29 05:55:26 -0300
committerJohan Dahlin <jdahlin@litl.com>2011-08-29 05:55:26 -0300
commitb41b31e9e47116984aeef8d7a8bc1e9832a8e722 (patch)
tree7a219d7fce5f67812ca5c40150b4a57c29130357
parente0fea819f0da1ca60cce3280e7e21f3d2955be3a (diff)
downloadgobject-introspection-b41b31e9e47116984aeef8d7a8bc1e9832a8e722.tar.gz
Add a make-check check to pre-commit hook
-rw-r--r--Makefile.am1
-rwxr-xr-xmisc/pre-commit16
2 files changed, 17 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 7f812852..6d90ab51 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,6 +63,7 @@ check-local:
is not executable\n\nrun chmod +x .git/hooks/pre-commit"; false))
@echo " PEP-8 INQUISITION"
@find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pep8.py --repeat --exclude=config.py
+ @touch $(top_srcdir)/.make-check-passed
check-pyflakes:
@echo " CHECK Pyflakes"
diff --git a/misc/pre-commit b/misc/pre-commit
index b25dce6b..1f37d866 100755
--- a/misc/pre-commit
+++ b/misc/pre-commit
@@ -68,3 +68,19 @@ perl -e '
}
exit($found_bad);
'
+
+CHECK_FILE=.make-check-passed
+if ! test -f $CHECK_FILE; then
+ echo "You need to run make check before committing"
+ exit 1
+fi
+
+# Need to run make check at least once every 20 minutes
+MODIFIED=`stat -c %Y $CHECK_FILE`
+NOW=`date +%s`
+DELTA=$(($NOW-MODIFIED))
+if test "$DELTA" -ge "1200"; then
+ echo "You haven't ran make check in $((DELTA / 60)) minutes."
+ exit 1
+fi
+