-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
skip directories not patterns #1113
Comments
You can't do this in the 2.x versions, but that optimisation has been made during the refactoring of the 3.x version. The 3.x version was specifically designed to make these sort of improvements easier to make. If you download and try 3.0.0a1, that exclude pattern will exclude the vendor dir and not check anything else under it. But the code between the two versions is very different, so these sort of improvements have not been backported. The workaround you'v got now is, unfortunately, the only way to speed it up. Does that explain things? |
Closing as I assume the explanation was ok given no feedback. If not, please comment again. |
Is it possible to skip an entire directory without traversing it for a pattern? For example
a typical laravel tree looks like:
in my phpcs.xml file I have:
when I run phpcs the run time is about 1 minute. If I painstakingly add all of the directories like this:
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 atCreating 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 thetype="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)
.The text was updated successfully, but these errors were encountered: