From 34ce3bf3f8edd1f44402480bd89983f7dbdca8a1 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 7 Nov 2020 15:32:56 -0500 Subject: [PATCH] Add pre-commit hook to repo --- .hooks/pre-commit | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 .hooks/pre-commit diff --git a/.hooks/pre-commit b/.hooks/pre-commit new file mode 100755 index 00000000..957a0411 --- /dev/null +++ b/.hooks/pre-commit @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +pushd $( git rev-parse --show-toplevel ) &>/dev/null + +ex=0 + +# Linting +./lint +if [[ $? -ne 0 ]]; then + echo "Aborting commit due to linting errors." + ex=1 +fi + +echo +popd &>/dev/null +exit $ex