Skip to content

Instantly share code, notes, and snippets.

@renoirtech
Forked from ogorzalka/pre-commit.sh
Last active October 13, 2022 19:27
Show Gist options
  • Save renoirtech/c4d0e905ae950aaab5d701d7740c8653 to your computer and use it in GitHub Desktop.
Save renoirtech/c4d0e905ae950aaab5d701d7740c8653 to your computer and use it in GitHub Desktop.
Only push if pint validation find no errors
#!/bin/bash
# Check if Laravel Pint is installed.
which ./vendor/bin/pint &> /dev/null
if [[ "$?" == 1 ]]; then
echo -e "\e[31mPlease install Pint (composer require laravel/pint --dev)\e[0m"
exit 1
fi
# Run Pint to inspect your code for style errors without actually changing the files
./vendor/bin/pint --test --config ./pint.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment