Skip to content

skip directories not patterns #1113

@wstaples

Description

@wstaples

Is it possible to skip an entire directory without traversing it for a pattern? For example
a typical laravel tree looks like:

.  
├── app  
├── bootstrap  
├── config  
├── database  
├── public  
├── resources  
├── storage  
├── tests  
└── vendor  

in my phpcs.xml file I have:

<file>.</file>
<exclude-pattern>./vendor/*</exclude-pattern>

when I run phpcs the run time is about 1 minute. If I painstakingly add all of the directories like this:

<file>./app</file>
<file>./bootstrap</file>
<file>./config</file>
<file>./database</file>
<file>./public</file>
<file>./resources</file>
<file>./storage</file>
<file>./tests</file>

then the run time of phpcs is about 1 second.

If I use the -v option I can see that in both cases it will say Creating file list... DONE (55 files in queue) however using the exclude-pattern it gets stuck at Creating file list forever. Which is why I believe it is still traversing the vendor directory even though it is ignored. I have tried a few variations on the pattern (vendor, vendor/*, ./vendor/*) I also tried using the type="relative" attribute as well. I also tried using --ignore

I'm on an Ubuntu 14.04 64-bit box with PHP_CodeSniffer version 2.6.2 (stable) by Squiz (http://www.squiz.net).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions