Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -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"
36 changes: 1 addition & 35 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -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)
Expand Down