2016-09-22 62 views
1

我有路徑問題。我正在嘗試設置SublimeText3和WordPress編碼標準。我在Mac上使用寬度爲XAMPP。SublimeLinter:警告:phpcs已停用,找不到'phpcs'

我phpcs文件位於/ Applications/XAMPP/xamppfiles/PHP_CodeSniffer /腳本/

在我把上面的路徑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' 
+0

http://www.sublimelinter.com/en/latest/global_settings.html#paths-setting – MattDMo

+0

請看看我的編輯 – user3684098

+0

Heeeeeelp pleaaase – user3684098

回答

3

刪除cmd參數。

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

然後將path添加到腳本存在的位置。

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

您可能需要重新啓動Sublime Text。

+0

謝謝!那就是訣竅。 –