0

如何在 phpcs 中加载多个编码标准?

在嗅探文件时,我应该使用一个使用三种编码标准的 xml 文件。

当我尝试一一设置它们的路径时,只会存储最近的路径并替换旧标准。

phpcs --config-set installed_paths ../wordpress-coding-standards;

phpcs --config-set installed_paths ../wordpress-coding-standards/PHPCompatibility;

我也尝试用父目录设置这个值,但它没有用。这是引发错误的最终命令:

phpcs -p -s -v  -n --standard=phpcs.xml /path/to/files

这是上面命令中使用的 xml 文件: https ://github.com/xwp/wp-dev-lib/blob/master/phpcs.xml

任何帮助,将不胜感激。谢谢!

4

1 回答 1

2

通过指定用逗号分隔的多个路径来解决它。

phpcs --config-set installed_paths first/path/,second/path/,yet/another/path/
于 2017-09-15T06:08:40.443 回答