laravel / pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.

Home Page:https://laravel.com/docs/pint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New `--dirty` breaks pre-commit hooks for new commits with non-php code changes

joelbutcher opened this issue · comments

  • Pint Version: 1.4.0
  • PHP Version: 8.1.14

Description:

I have a large monorepo with Laravel Pint at the project root. I was planning on using Pint in a pre-commit hook with the --dirty option, but the project also contains packages that aren't PHP files (Vue, Python etc.) and using this option prevents developers from committing changes to projects that aren't written in PHP

Steps To Reproduce:

  1. Create a monorepo with a new Laravel project and new Vue.js project
  2. Install Laravel Pint at project root
  3. Create pre-commit hook to run ./vendor/bin/pint --dirty
  4. Make a PHP code change and commit
  5. Make a Vue code change and try to commit
  6. See error