From 262f161f42c4e59beec41c6f440336c38385426a Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Wed, 20 Dec 2023 20:46:00 -0600 Subject: Initial commit --- .githooks/pre-commit | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .githooks/pre-commit (limited to '.githooks') diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..de1c2ce --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +git stash --keep-index --include-untracked --message "Pre-commit hook" + +lintStageResult=0 +dune build && dune runtest || lintStageResult=$? + +git stash pop +if [ $lintStageResult -ne 0 ]; then + echo "Test stage failed" + exit 1 +fi + +git notes append -m "Built and tested with dune +Reported-by: precommit hook" + + + -- cgit v1.2.3