From 23dbda302ea06b5f899fce02e949de360cca659a Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Fri, 11 Mar 2022 21:24:34 +0000 Subject: [PATCH] fix: ensuring pre-commit fails when sasjs lint fails --- .git-hooks/pre-commit | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index 3d00ad3..6e431bf 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -1,5 +1,12 @@ #!/bin/bash -sasjs lint + +# Ensure lint is passing +LINT=`sasjs lint` +if [[ "$LINT" != "✔ All matched files use @sasjs/lint code style!" ]]; then + echo "$LINT" + echo "To commit in spite of these warnings, use the -n parameter." + exit 1 +fi # Avoid commits to the master branch BRANCH=`git rev-parse --abbrev-ref HEAD`