diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 00000000..3fe92c4a --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if ! shellcheck -S error NfsDiagnostics/nfsclientlogs.sh SMBDiagnostics/smbclientlogs.sh +then + echo "Shellcheck failed" + exit 1 +fi diff --git a/enable-hooks.md b/enable-hooks.md new file mode 100644 index 00000000..4a457dc3 --- /dev/null +++ b/enable-hooks.md @@ -0,0 +1 @@ +Run this command in repo's root directory to enable local validations: `git config core.hooksPath .githooks`