我尝试将 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
看起来某处存在权限问题,但是:
- 我已将 /opt/local/lib/php/pear/bin 中的 phpcs 文件设置为可执行文件并检查了所有父目录
- 我已将 sublime 包目录中的 phpcs.py 设置为可执行文件(尽管不确定是否需要它),与父目录同上
- 我已经检查过了,我可以在命令行上很好地运行 phpcs。它在 PATH 中,它做它应该做的事情并返回没有错误的结果。
根据 ms4py 注释更新输出 - ln 105 处的“打印 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']