Ver código fonte

Allow bypassing the pre-commit script with NOVALIDATE=1

jeremystretch 4 anos atrás
pai
commit
e04402ed57
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      scripts/git-hooks/pre-commit

+ 6 - 0
scripts/git-hooks/pre-commit

@@ -11,6 +11,7 @@ exec 1>&2
 
 EXIT=0
 RED='\033[0;31m'
+YELLOW='\033[0;33m'
 NOCOLOR='\033[0m'
 
 if [ -d ./venv/ ]; then
@@ -22,6 +23,11 @@ if [ -d ./venv/ ]; then
     fi
 fi
 
+if [ ${NOVALIDATE} ]; then
+  echo "${YELLOW}Skipping validation checks${NOCOLOR}"
+  exit $EXIT
+fi
+
 echo "Validating PEP8 compliance..."
 pycodestyle --ignore=W504,E501 --exclude=node_modules netbox/
 if [ $? != 0 ]; then