From 62d7423d96f524553d839657907f2f9cce6d5cfa Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 12 Jul 2018 20:01:39 +0200 Subject: [PATCH] Extend commit hook with static tests --- Hooks/syntax.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Hooks/syntax.sh b/Hooks/syntax.sh index d7b4263..e5c9ef5 100644 --- a/Hooks/syntax.sh +++ b/Hooks/syntax.sh @@ -24,6 +24,18 @@ if [[ "$FILE" =~ ^.+(php)$ ]]; then echo -e "\e[1;31m\tMess Detector error.\e[0m" >&2 exit 1 fi + + # phan + ${rootpath}/vendor/bin/phan -k ${rootpath}/Build/Config/phan.php -f $FILE + if [ $? -ne 0 ]; then + echo -e "\e[1;31m\tPhan warning.\e[0m" >&2 + fi + + # phpstan + php -d memory_limit=4G ${rootpath}/vendor/bin/phpstan analyse --autoload-file=${rootpath}/phpOMS/Autoloader.php -l 7 -c ${rootpath}/Build/Config/phpstan.neon $FILE + if [ $? -ne 0 ]; then + echo -e "\e[1;31m\tPhp stan warning.\e[0m" >&2 + fi fi fi