![]() By following these steps, you can ensure that your code adheres to the coding standards and that your tests pass before pushing code changes to your repository. Sort Tailwind CSS classes (even inside PHP code). In conclusion, setting up Git hooks for Pint and Pest with Laravel Sail is a straightforward process that can save you time by automatically running tests before committing code changes. RT zepfietje: Support for AlpineJS coming to the laravelphp Blade formatter Format PHP using Laravel Pint. If you encounter any issues, check that Pint and Pest are installed and that the paths in the pre-commit file are correct. PASS Tests: 2, Assertions: 2, Passed: 2, Skipped: 0, Incomplete: 0, Risky: 0, Error: 0, Failed: 0 Attempt to commit your changes, and you should see output similar to the following: Save the changes to the pre-commit file and make a change to your code. ![]() It first runs Pint and then runs Pest using Laravel Sail if the sail script exists otherwise, it runs Pest using the local vendor/bin/sail script. This code runs Pint and Pest before a Git commit is executed. & bash sail pest || bash vendor/bin/sail pest Open the pre-commit file in a text editor and add the following code:įiles=$(git diff -cached -name-only -diff-filter=ACM - '*.php')
0 Comments
Leave a Reply. |