Closed MaartenStaa closed 8 years ago
try the following in your ruleset
<!-- Exclude folders not containing production code -->
<exclude-pattern>*/foo/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
from the command line I think you would do --ignore=*/foo/*,*/vendor/*
On the command line, you can also run with --ignore=*/foo/*,*/vendor/*
.
Note that the folder name you are ignoring and the name of the standard you are using are not related in any way inside PHP_CodeSniffer, so you aren't telling PHPCS to ignore your standard while checking files.
If you want to see what PHPCS is checking, run it with the -v
command line argument and it will show how many files it found to check, how many sniffs it is using for checking, and the results of each file it checked.
Thanks, that seemed to work after some tinkering. The project is actually also under a directory called foo, and just --ignore=*/foo/*,*/vendor*
was also producing a shell error (zsh).
In the end the solution was to use --ignore="
pwd/foo/*,
pwd/vendor/*"
.
Hi,
I have a custom standard under folder
foo
. It contains theruleset.xml
file and modified versions of certain sniffs, as well as custom ones.I would like to run phpcs with
--ignore=foo,vendor
to not sniff files under those two folders, but it results in 0 warnings and errors every time, sincefoo
is also the name of the ruleset. Is there a way around this?Thanks.