Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the filenames expasions #24

Merged

Conversation

david-binda
Copy link
Collaborator

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

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.
Copy link
Owner

@sirbrillig sirbrillig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool. Thank you!

@sirbrillig sirbrillig merged commit 2313396 into sirbrillig:master Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants