sirbrillig / phpcs-changed

🐘 Run phpcs on files and only report new warnings/errors compared to the previous version.
MIT License
31 stars 11 forks source link

Fix the filenames expasions #24

Closed david-binda closed 4 years ago

david-binda commented 4 years ago

The current implementation via glob ignores .php files in current dir in case . is passed as file list, and also ignores nested directories.

To fix the issue, this commit introduces a more solid implementation via RecursiveDirectoryIterator with appropriate filtering.

The issue can be demonstrated when running the phpcs-changed eg.: for the liveblog plugin from within the root directory of the plugin. In such case, the following files are ignored:

./liveblog.php
./templates/amp/feed.ph
./templates/amp/pagination.ph
./templates/amp/entry.php
./templates/amp/author.php