[英]How to call a custom ruleset.xml for php code sniffer
我正在嘗試為php代碼嗅探器編寫自定義ruleset.xml,但是從命令行調用它而不將其放在默認文件夾中似乎不起作用。
由於文件似乎陳述,否則我想問我在這里做錯了什么
:~/$ phpcs --standard=/home/edo/custom_ruleset.xml source/
===>
ERROR: the "/home/edo/custom_ruleset.xml" coding standard is not installed.
The installed coding standards are PEAR, PHPCS, Zend, Squiz and MySource
如果這不起作用:有關如何使用您的來源發送您自己的編碼標准的任何建議? 謝謝
您至少需要Code Sniffer的1.3.0a1版本才能使用帶注釋的規則集:
- 所有CodingStandard.php文件都已被ruleset.xml文件替換
需要將自定義標准轉換為此新格式才能繼續工作- 您可以使用
--standard
命令行arg指定自己的自定義ruleset.xml文件的路徑,例如,phpcs --standard=/path/to/my/ruleset.xml
在此之前,您必須復制規則集,如本教程中所述 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.