mac下安装了sublime text3后持续安装了一些插件,其中有php code sniffer,简称phpcs。用来提示php语法错误的。安装后,无法显示,我根据官网的提示,安装了phpcs需要的一些插件,包括:php-cs-fixer,phpcbf,phpmd.并且配置了phpcs的文件然而还是无法提示。
附上配置文件:
\这里开始
{
// plugin settings// turn the debug output on/offshow_debug: true,// which file types (file extensions), do you want the plugin to// execute forextensions_to_execute: [php],// do we need to blacklist any sub extensions from extensions_to_execute// an example would be [twig.php]extensions_to_blacklist: [twig.php],// execute the sniffer on file savephpcs_execute_on_save: false,// show the error list after save.phpcs_show_errors_on_save: true,// show the errors in the gutterphpcs_show_gutter_marks: true,// show outline for errorsphpcs_outline_for_errors: true,// show the errors in the status barphpcs_show_errors_in_status: true,// show the errors in the quick panel so you can then goto linephpcs_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 possiblephpcs_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 possiblephpcs_commands_to_php_prefix: [],// what color to stylise the icon// https://www.sublimetext.com/docs/3/api_reference.html#sublime.view// add_regsionsphpcs_icon_scope_color: comment,
// php_codesniffer settings// do you want to run the phpcs checker?phpcs_sniffer_run: true,// execute the sniffer on file savephpcs_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 valuephpcs_executable_path: /usr/local/bin/phpcs,// additional arguments you can specify into the application//// example:// {// --standard: pear,// -n// }
phpcs_additional_args: {
--standard: psr2, --config-set: show_warnings 0,-n: ,-l:
},
// php-cs-fixer settings// fix the issues on savephp_cs_fixer_on_save: false,// show the quick panelphp_cs_fixer_show_quick_panel: true,// path to where you have the php-cs-fixer installedphp_cs_fixer_executable_path: /usr/local/bin/php-cs-fixer,// additional arguments you can specify into the applicationphp_cs_fixer_additional_args: { --level: all},
// phpcbf settings// fix the issues on savephpcbf_on_save: true,// show the quick panelphpcbf_show_quick_panel: true,// path to where you have the phpcbf installedphpcbf_executable_path: /usr/local/bin/phpcbf,// 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 savephpcs_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 valuephpcs_php_path: ,// what is the regex for the linter? has to provide a named match for 'message' and 'line'phpcs_linter_regex: (?p.*) on line (?p\\d+),
// php mess detector settings// execute phpmdphpmd_run: true,// execute the phpmd on file savephpmd_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 valuephpmd_executable_path: /usr/local/bin/phpmd,// additional arguments you can specify into the application//// example:// {// codesize,unusedcode// }phpmd_additional_args: { codesize,unusedcode,naming: },
// php scheck settings// execute scheckscheck_run: false,// execute the scheck on file savescheck_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 valuescheck_executable_path: ,// additional arguments you can specify into the application////example://{// -php_stdlib : /path/to/pfff,// -strict : //}scheck_additional_args: { -strict : }
}
//这里结束
下面是安装完,错误依旧没提示。
有朋友用过这个插件的么,帮下忙啊!!!
回复内容: mac下安装了sublime text3后持续安装了一些插件,其中有php code sniffer,简称phpcs。用来提示php语法错误的。安装后,无法显示,我根据官网的提示,安装了phpcs需要的一些插件,包括:php-cs-fixer,phpcbf,phpmd.并且配置了phpcs的文件然而还是无法提示。
附上配置文件:
\这里开始
{
// plugin settings// turn the debug output on/offshow_debug: true,// which file types (file extensions), do you want the plugin to// execute forextensions_to_execute: [php],// do we need to blacklist any sub extensions from extensions_to_execute// an example would be [twig.php]extensions_to_blacklist: [twig.php],// execute the sniffer on file savephpcs_execute_on_save: false,// show the error list after save.phpcs_show_errors_on_save: true,// show the errors in the gutterphpcs_show_gutter_marks: true,// show outline for errorsphpcs_outline_for_errors: true,// show the errors in the status barphpcs_show_errors_in_status: true,// show the errors in the quick panel so you can then goto linephpcs_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 possiblephpcs_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 possiblephpcs_commands_to_php_prefix: [],// what color to stylise the icon// https://www.sublimetext.com/docs/3/api_reference.html#sublime.view// add_regsionsphpcs_icon_scope_color: comment,
// php_codesniffer settings// do you want to run the phpcs checker?phpcs_sniffer_run: true,// execute the sniffer on file savephpcs_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 valuephpcs_executable_path: /usr/local/bin/phpcs,// additional arguments you can specify into the application//// example:// {// --standard: pear,// -n// }
phpcs_additional_args: {
--standard: psr2, --config-set: show_warnings 0,-n: ,-l:
},
// php-cs-fixer settings// fix the issues on savephp_cs_fixer_on_save: false,// show the quick panelphp_cs_fixer_show_quick_panel: true,// path to where you have the php-cs-fixer installedphp_cs_fixer_executable_path: /usr/local/bin/php-cs-fixer,// additional arguments you can specify into the applicationphp_cs_fixer_additional_args: { --level: all},
// phpcbf settings// fix the issues on savephpcbf_on_save: true,// show the quick panelphpcbf_show_quick_panel: true,// path to where you have the phpcbf installedphpcbf_executable_path: /usr/local/bin/phpcbf,// 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 savephpcs_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 valuephpcs_php_path: ,// what is the regex for the linter? has to provide a named match for 'message' and 'line'phpcs_linter_regex: (?p.*) on line (?p\\d+),
// php mess detector settings// execute phpmdphpmd_run: true,// execute the phpmd on file savephpmd_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 valuephpmd_executable_path: /usr/local/bin/phpmd,// additional arguments you can specify into the application//// example:// {// codesize,unusedcode// }phpmd_additional_args: { codesize,unusedcode,naming: },
// php scheck settings// execute scheckscheck_run: false,// execute the scheck on file savescheck_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 valuescheck_executable_path: ,// additional arguments you can specify into the application////example://{// -php_stdlib : /path/to/pfff,// -strict : //}scheck_additional_args: { -strict : }
}
//这里结束
下面是安装完,错误依旧没提示。
有朋友用过这个插件的么,帮下忙啊!!!