Sublimetext3 升华3中的配置PHPC

Sublimetext3 升华3中的配置PHPC,sublimetext3,phpcs,Sublimetext3,Phpcs,我已将默认phpcs.sublime-settings复制粘贴到用户,并将phpcs\u execute\u on\u save设置为true,但它不起作用。 它向我显示了一个错误 Exception in thread Thread-9: Traceback (most recent call last): File "./python3.3/subprocess.py", line 1104, in _execute_child FileNotFoundError: [WinError

我已将默认phpcs.sublime-settings复制粘贴到用户,并将phpcs\u execute\u on\u save设置为true,但它不起作用。 它向我显示了一个错误

Exception in thread Thread-9:
Traceback (most recent call last):
  File "./python3.3/subprocess.py", line 1104, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "phpcs in C:\Users\hassan\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 488, in run
  File "phpcs in C:\Users\hassan\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 149, in get_errors
  File "phpcs in C:\Users\hassan\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 231, in execute
  File "phpcs in C:\Users\hassan\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 234, in parse_report
  File "phpcs in C:\Users\hassan\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 176, in shell_out
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1110, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
我在安装和配置PHPC时做错了什么

这是配置文件

{
// Plugin settings

// Turn the debug output on/off
"show_debug": false,

// Which file types (file extensions), do you want the plugin to
// execute for
"extensions_to_execute": ["php"],

// Do we need to blacklist any sub extensions from extensions_to_execute
// An example would be ["twig.php"]
"extensions_to_blacklist": [],

// Execute the sniffer on file save
"phpcs_execute_on_save": true,

// Show the error list after save.
"phpcs_show_errors_on_save": true,

// Show the errors in the gutter
"phpcs_show_gutter_marks": true,

// Show outline for errors
"phpcs_outline_for_errors": true,

// Show the errors in the status bar
"phpcs_show_errors_in_status": true,

// Show the errors in the quick panel so you can then goto line
"phpcs_show_quick_panel": true,

// The path to the php executable.
// Needed for windows, or anyone who doesn't/can't make phars
// executable. Avoid setting this if at all possible
"phpcs_php_prefix_path": "",

// Options include:
// - Sniffer
// - Fixer
// - Mess Detector
//
// This will prepend the application with the path to php
// Needed for windows, or anyone who doesn't/can't make phars
// executable. Avoid setting this if at all possible
"phpcs_commands_to_php_prefix": [],

// What color to stylise the icon
// https://www.sublimetext.com/docs/3/api_reference.html#sublime.View
// add_regsions
"phpcs_icon_scope_color": "comment",


// PHP_CodeSniffer settings

// Do you want to run the phpcs checker?
"phpcs_sniffer_run": true,

// Execute the sniffer on file save
"phpcs_command_on_save": true,

// It seems python/sublime cannot always find the phpcs application
// If empty, then use PATH version of phpcs, else use the set value
"phpcs_executable_path": "",

// Additional arguments you can specify into the application
//
// Example:
// {
//     "--standard": "PEAR",
//     "-n"
// }
"phpcs_additional_args": {
    "--standard": "PSR2",
    "-n": ""
},



// PHP-CS-Fixer settings

// Fix the issues on save
"php_cs_fixer_on_save": false,

// Show the quick panel
"php_cs_fixer_show_quick_panel": false,

// Path to where you have the php-cs-fixer installed
"php_cs_fixer_executable_path": "",

// Additional arguments you can specify into the application
"php_cs_fixer_additional_args": {

},



// phpcbf settings

// Fix the issues on save
"phpcbf_on_save": false,

// Show the quick panel
"phpcbf_show_quick_panel": false,

// Path to where you have the phpcbf installed
"phpcbf_executable_path": "",

// Additional arguments you can specify into the application
//
// Example:
// {
//     "--level": "all"
// }
"phpcbf_additional_args": {
    "--standard": "PSR2",
    "-n": ""
},



// PHP Linter settings

// Are we going to run php -l over the file?
"phpcs_linter_run": true,

// Execute the linter on file save
"phpcs_linter_command_on_save": true,

// It seems python/sublime cannot always find the php application
// If empty, then use PATH version of php, else use the set value
"phpcs_php_path": "",

// What is the regex for the linter? Has to provide a named match for 'message' and 'line'
"phpcs_linter_regex": "(?P<message>.*) on line (?P<line>\\d+)",



// PHP Mess Detector settings

// Execute phpmd
"phpmd_run": false,

// Execute the phpmd on file save
"phpmd_command_on_save": true,

// It seems python/sublime cannot always find the phpmd application
// If empty, then use PATH version of phpmd, else use the set value
"phpmd_executable_path": "",

// Additional arguments you can specify into the application
//
// Example:
// {
//     "codesize,unusedcode"
// }
"phpmd_additional_args": {
    "codesize,unusedcode,naming": ""
},


// PHP Scheck settings

// Execute scheck
"scheck_run": false,

// Execute the scheck on file save
"scheck_command_on_save": false,

// It seems python/sublime cannot always find the scheck application
// If empty, then use PATH version of scheck, else use the set value
"scheck_executable_path": "",

// Additional arguments you can specify into the application
//
//Example:
//{
//  "-php_stdlib" : "/path/to/pfff",
//  "-strict" : ""
//}
"scheck_additional_args": {
    "-strict" : ""
}
{
//插件设置
//打开/关闭调试输出
“show_debug”:false,
//您希望插件使用哪些文件类型(文件扩展名)
//执行
“扩展到执行”:[“php”],
//我们需要黑名单从扩展到执行的任何子扩展吗
//例如[“twig.php”]
“黑名单的扩展”:[],
//在文件保存时执行嗅探器
“phpcs在保存时执行”:真,
//保存后显示错误列表。
“phpcs在保存时显示错误”:真,
//在边沟中显示错误
“phpcs_显示_排水沟_标记”:正确,
//显示错误的大纲
“phpcs\U错误大纲”:正确,
//在状态栏中显示错误
“phpcs\u显示\u错误\u处于\u状态”:true,
//在快速面板中显示错误,以便您可以转到行
“phpcs显示快速面板”:正确,
//php可执行文件的路径。
//windows或任何不/不能制作Phar的人都需要
//可执行。尽可能避免设置此选项
“phpcs\u php\u前缀\u路径”:“”,
//选择包括:
//-嗅探器
//-定影器
//-混乱探测器
//
//这将在应用程序前面加上指向php的路径
//windows或任何不/不能制作Phar的人都需要
//可执行。尽可能避免设置此选项
“phpcs_命令_至_php_前缀”:[],
//图标的样式是什么颜色
// https://www.sublimetext.com/docs/3/api_reference.html#sublime.View
//添加规则
“phpcs图标、范围、颜色”:“注释”,
//PHP_代码嗅探器设置
//是否要运行phpcs检查程序?
“phpcs嗅探器运行”:正确,
//在文件保存时执行嗅探器
“phpcs_命令_on_save”:真,
//python/sublime似乎无法始终找到phpcs应用程序
//如果为空,则使用phpcs的路径版本,否则使用设置值
“phpcs_可执行路径”:“”,
//可以在应用程序中指定的其他参数
//
//例如:
// {
//“--标准”:“梨”,
//“-n”
// }
“phpcs附加参数”:{
“--标准”:“PSR2”,
“-n”:”
},
//PHP CS修复程序设置
//修复save上的问题
“php_cs_fixer_on_save”:false,
//显示快速面板
“php\u cs\u fixer\u show\u quick\u panel”:false,
//安装php cs修复程序的路径
“php\u cs\u fixer\u可执行文件路径”:“”,
//可以在应用程序中指定的其他参数
“php\u cs\u fixer\u附加参数”:{
},
//phpcbf设置
//修复save上的问题
“phpcbf_on_save”:false,
//显示快速面板
“phpcbf\u显示\u快速\u面板”:错误,
//安装phpcbf的路径
“phpcbf_可执行文件_路径”:“”,
//可以在应用程序中指定的其他参数
//
//例如:
// {
//--级别:“所有”
// }
“phpcbf_附加参数”:{
“--标准”:“PSR2”,
“-n”:”
},
//PHP Linter设置
//我们要在文件上运行php-l吗?
“phpcs_linter_run”:正确,
//在文件保存时执行linter
“phpcs_linter_命令_on_save”:正确,
//python/sublime似乎无法始终找到php应用程序
//如果为空,则使用php的路径版本,否则使用设置值
“phpcs\u php\u路径”:“,
//linter的正则表达式是什么?必须为“message”和“line”提供命名匹配
“phpcs_linter_regex”:“(?P.*)在线(?P\\d+)”,
//PHP混乱检测器设置
//执行phpmd
“phpmd_运行”:false,
//在文件保存时执行phpmd
“phpmd_命令_on_save”:真,
//python/sublime似乎无法始终找到phpmd应用程序
//如果为空,则使用phpmd的路径版本,否则使用设置值
“phpmd_可执行文件_路径”:“”,
//可以在应用程序中指定的其他参数
//
//例如:
// {
//代码大小,未使用的代码
// }
“phpmd_附加参数”:{
代码大小、未使用的代码、命名:
},
//PHP Scheck设置
//执行scheck
“scheck_run”:错误,
//在文件保存时执行scheck
“scheck_命令_on_save”:false,
//python/sublime似乎无法始终找到scheck应用程序
//如果为空,则使用scheck的路径版本,否则使用设置值
“scheck_可执行路径”:“”,
//可以在应用程序中指定的其他参数
//
//例如:
//{
//“-php_stdlib”:“/path/to/pfff”,
//“-严格”:”
//}
“scheck_附加参数”:{
“-严格”:”
}

}

我已将phpcs\u可执行文件路径添加到右侧,并更改此程序包的用户设置

路径上是否有
phpcs
可执行文件?如果没有,您应该在
phpcs.sublime settings
文件中适当设置
phpcs\u executable\u path。配置默认文件中没有任何带有“phpcs\u executable\u path”的字符串,谢谢@KeithHall解决