我试图将Php Code Sniffer与Sublime一起使用,但是在sublime终端我每次尝试嗅探文件时都会得到以下内容:
Traceback (most recent call last):
File "./sublime_plugin.py", line 350, in run_
File "./phpcs.py", line 382, in run
File "./phpcs.py", line 270, in run
File "./phpcs.py", line 98, in get_errors
File "./phpcs.py", line 138, in execute
File "./phpcs.py", line 141, in parse_report
File "./phpcs.py", line 106, in shell_out
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
看起来某处存在权限问题,但是:
根据ms4py注释更新输出 - 在ln 105处的'print cmd':
['php', '-l', '-d display_errors=On', u'/Users/pete/projects/portal/apps/frontend/modules/chilled/actions/actions.class.php']
[u'/opt/local/lib/php/pear/bin', '--report=checkstyle', '-n', u'--standard=PEAR', u'/Users/pete/projects/portal/apps/frontend/modules/chilled/actions/actions.class.php']
答案 0 :(得分:1)
将评论放在此答案中并标记为社区维基:
检查一下,这是修复: github.com/benmatselby/sublime-phpcs/issues/4 - schlamar May 29' 12 在13:47
设置应该直接链接到可执行文件:
'/opt/local/lib/php/pear/bin/phpcs'
- schlamar May 29' 12 at 14:15
正如在github问题中所解释的那样,phpcs中有一个新的设置来修复这个问题,允许用户提供一个php cs可执行文件的路径,如果Sublime无法自动找到它:
phpcs_executable_path