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

Dirty files not matched recursively

valorin opened this issue · comments

  • Pint Version: 1.7.0
  • PHP Version: 8.1.16
  • Ubuntu Version: 20.04.5 LTS
  • Git Version: 2.25.1
  • Bash Version: 5.0.17

Description:

Pint appears to use the following command to find dirty files;:

git status --short -- *.php

However, on Ubuntu with Git and Bash, that only returns matches from the current level:

$ git status --short
 M _ide_helper.php
 M composer.json
 M composer.lock
 M package-lock.json
 M public/vendor/horizon/app.js
 M public/vendor/horizon/mix-manifest.json
 M resources/views/attack.blade.php
 M resources/views/modules/attack/csrf/challenges.blade.php
 M resources/views/target/csrf.blade.php

$ git status --short -- *.php
 M _ide_helper.php

In order to match files recursively, I need to do this:

$ git status --short -- "**.php"
 M _ide_helper.php
 M resources/views/attack.blade.php
 M resources/views/modules/attack/csrf/challenges.blade.php
 M resources/views/target/csrf.blade.php

I am guessing the issue is different matching rules for different platforms. The "**.php" looks more robust at a glance, but I don't have other environments to test on to confirm.

Made pull request to address this issue.