diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..6ecdc73 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +echo "=============================================" +echo "Pre Commit Hook - Running pint tests ๐Ÿงช" +echo "=============================================" + +pint_output=$(./vendor/bin/pint --test 2>&1) + +if [ $? -ne 0 ]; then + echo "Pint tests failed. Please fix the issues before pushing." + exit 1 +fi + +echo "๐ŸŸข Pint Ok!" + +echo "\n" + +echo "=============================================" +echo "Pre Commit Hook - Running PHPStan tests ๐Ÿงช" +echo "=============================================" + +pint_output=$(./vendor/bin/phpstan analyse -l 9 src tests 2>&1) + +if [ $? -ne 0 ]; then + echo "PHPStan tests failed. Please fix the issues before pushing." + exit 1 +fi + +echo "๐ŸŸข PHPStan Ok!" + +echo "\n" \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push index 42deb54..61798db 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,41 +1,7 @@ #!/usr/bin/env sh -echo "=============================================" -echo "Running pre-push hook ๐Ÿš€" -echo "=============================================" -echo "\n" -echo "=============================================" -echo "Running pint tests ๐Ÿงช" -echo "=============================================" - -pint_output=$(./vendor/bin/pint --test 2>&1) - -if [ $? -ne 0 ]; then - echo "Pint tests failed. Please fix the issues before pushing." - exit 1 -fi - -echo "๐ŸŸข Pint Ok!" - -echo "\n" - -echo "=============================================" -echo "Running PHPStan tests ๐Ÿงช" -echo "=============================================" - -pint_output=$(./vendor/bin/phpstan analyse -l 9 src tests 2>&1) - -if [ $? -ne 0 ]; then - echo "PHPStan tests failed. Please fix the issues before pushing." - exit 1 -fi - -echo "๐ŸŸข PHPStan Ok!" - -echo "\n" - # echo "=============================================" -# echo "Running pest tests ๐Ÿงช" +# echo "Pre Push Hook - Running pest tests ๐Ÿงช" # echo "=============================================" # pest_output=$(./vendor/bin/pest --colors=always --stop-on-failure 2>&1)