You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider I would like to exclude files in bin directories:
<exclude-pattern>*/bin/*</exclude-pattern>
Unfortunately, this rule will also match ./src/BingSearch.php
I don't have time right now to write a properly tested PR, but I believe the issue is on Filter.php#L207.
if (substr($pattern, -2) === '/*') {
// Need to check this pattern for dirs as well as individual file paths.$pattern = substr($pattern, 0, -2);
$this->ignoreDirPatterns[$pattern] = $type;
$this->ignoreFilePatterns[$pattern] = $type;
So in this case it will strip that trailing slash to identify directories, but it also adds that pattern to the files array. I think this can be remedied by leaving the slash on for file patterns and only removing it for directory patterns, e.g.
gsherwood
changed the title
directory exclude pattern improperly excludes files with names that start the same
Directory exclude pattern improperly excludes files with names that start the same
Mar 20, 2018
Thanks for reporting this, and thanks for your suggested changes. I ended up leaving the pattern as-is for file checking and only doing the substr for the directories.
Consider I would like to exclude files in
bin
directories:Unfortunately, this rule will also match
./src/BingSearch.php
I don't have time right now to write a properly tested PR, but I believe the issue is on Filter.php#L207.
So in this case it will strip that trailing slash to identify directories, but it also adds that pattern to the files array. I think this can be remedied by leaving the slash on for file patterns and only removing it for directory patterns, e.g.
The text was updated successfully, but these errors were encountered: