Files
vision/DEMO_GIT_HOOK_PRE-PUSH
Xbird 9f22f5b1ee V-Beta-1.0.0
Vision is out of alpha !
2022-02-02 17:46:29 +01:00

37 lines
674 B
Bash

#!/bin/sh
# Check for phpcs
which ./vendor/bin/phpcs
if [[ "$?" == 1 ]]; then
echo " Please install PHPCS "
exit 1
fi
# Check for phpstan
which ./vendor/bin/phpstan
if [[ "$?" == 1 ]]; then
echo " Please install phpstan"
exit 1
fi
echo " -- PHPCBF -- "
./vendor/bin/phpcbf --colors --standard=PSR12 -p --ignore=./src/Kernel.php ./src
git add .
git commit -m "PHPCBF AUTO"
echo " -- PHPCS -- "
./vendor/bin/phpcs --colors --standard=PSR12 -p --ignore=./src/Kernel.php ./src
if [[ "$?" == 1 ]]; then
echo " PHPCS NOT OK"
exit 1
fi
echo " -- PHPSTAN -- "
./vendor/bin/phpstan analyse ./src
if [[ "$?" == 1 ]]; then
echo " PHPSTAN NOT OK"
exit 1
fi
exit 0