SublimeLinter:警告:phpcs已停用,无法找到' phpcs'

时间:2016-09-22 19:35:21

标签: wordpress sublimetext3 sublimelinter phpcs

我遇到了路径问题。我正在尝试设置SublimeText3和WordPress编码标准。我在Mac上工作宽度为XAMPP。

我的phpcs文件位于/ Applications / XAMPP / xamppfiles / PHP_CodeSniffer / scripts /

在SublimeLinter用户设置中,我将上面的路径放在:

"linters": {
        "phpcs": {
            "@disable": false,
            "args": [],
            "cmd": "/Applications/XAMPP/xamppfiles/PHP_CodeSniffer/scripts/phpcs",
            "excludes": [],
            "standard": "WordPress-VIP"
        }
    }

不幸的是编辑器无法找到phpcs:

SublimeLinter: WARNING: phpcs deactivated, cannot locate 'phpcs'

有人知道我的错误是什么吗?

问候!

编辑:

"paths": {
        "linux": [],
        "osx": [
            "/bin/bash"
        ],
        "windows": []
    }

然后我收到此错误:

SublimeLinter: user shell: /bin/bash 

SublimeLinter: computed PATH using /bin/bash:

/bin/bash

/usr/local/bin

/usr/bin

/bin

/usr/sbin

/sbin

SublimeLinter: WARNING: phpcs deactivated, cannot locate 'phpcs'

1 个答案:

答案 0 :(得分:4)

删除cmd参数。

"linters": {
    "phpcs": {
        "@disable": false,
        "args": [],
        "excludes": [],
        "standard": "WordPress-VIP"
    }
}

然后将path添加到脚本所在的位置。

"paths": {
    "linux": [],
    "osx": [
        "/Applications/XAMPP/xamppfiles/PHP_CodeSniffer/scripts"
    ],
    "windows": []
}

您可能需要重新启动Sublime Text。