我的插件文件中已经有用 Tabs 缩进的行。但是 PHPCS 仍然报告以下内容:
必须使用制表符来缩进;不允许有空格
32 | ERROR | [x] Tabs must be used to indent lines; spaces are not allowed
| | (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed)
命令行嗅探命令是
$ phpcs --standard=phpcs.xml.dist cool-media.filter.php > phpcs_errors.txt
示例代码片段:
function __construct() {
<TAB>$this->plugin = plugin_basename( __FILE__ );
<TAB>$this->taxonomy = 'category';
<TAB>$this->post_type = 'attachment';
<TAB>$this->text_domain = 'cool-media-filter';
<TAB>$this->taxonomy = apply_filters( 'cool_media_taxonomy', $this->taxonomy );
}
我不知道如何解决!
编辑器:
项目中使用的 PHPStorm 编码标准:WordPress 核心
规则集:https ://github.com/Automattic/_s/blob/master/phpcs.xml.dist
任何建议都会有所帮助。我是代码嗅探器的新手。
编辑(代码编辑器的屏幕截图)