简体   繁体   English

PHP代码嗅探器排除模式

[英]PHP code sniffer exclude-pattern

Hi I currently working on php coding sniffer. 嗨,我目前正在研究php编码嗅探器。 We are using the ruleset.xml file in PHPStorm as well on our TeamCity buildserver. 我们正在PHPStorm中以及在TeamCity构建服务器上使用ruleset.xml文件。 This works fine. 这很好。

The last thing we wanted todo is to exclude 3th party libraries. 我们要做的最后一件事是排除第三方图书馆。 What is do know is that we should us the <exclude-pattern> tag for this and that we should escape the pattern differently for Linux and Windows. 所知道的是,我们应该为此使用<exclude-pattern>标记,并且对于Linux和Windows,我们应该以不同的方式转义该模式。

What I do not understand is how to exclude a directory recursively. 我不明白的是如何递归排除目录。 For example how do I exclude X,Y, Z and all the files in those directories? 例如,如何排除X,Y,Z和这些目录中的所有文件?

 - Library
    - 3PartyStuff
      - X
      - Y
      - Z
    - Feeds
    - Products

It seems that putting the whole path into the exclude tag does not work for me. 似乎将整个路径放入exclude标签对我来说不起作用。

在命令行上,将目录添加到忽略:

--ignore=Library/3PartyStuff/X/*,Library/3PartyStuff/Y/*,Library/3PartyStuff/Z/*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM