Browse Source

Add pre-commit hooks

Andy Baugh 3 months ago
parent
commit
63e5becb01
2 changed files with 7 additions and 1 deletions
  1. 4 1
      Makefile
  2. 3 0
      githooks/pre-commit

+ 4 - 1
Makefile

@@ -1,3 +1,6 @@
+install-githooks:
+	install githooks/* .git/hooks/
+
 test: compilecheck
 	prove -mv t/*.t
 
@@ -9,4 +12,4 @@ tidy:
 	$(foreach FILE,$(FILES2CHECK),perltidy -b $(FILE) &&) /bin/true
 	perltidy -b t/*.t
 
-.PHONY: compilecheck test tidy
+.PHONY: compilecheck test tidy install-githooks

+ 3 - 0
githooks/pre-commit

@@ -0,0 +1,3 @@
+#!/bin/sh
+make test
+make tidy