benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
814 stars 126 forks source link

Unicode error #118

Closed kafein-ben closed 10 years ago

kafein-ben commented 10 years ago

Hi,

First of all, thanks for maintaining this plugin.

After installing phpcs on my sublime text 3, I get the following error in the console on a php file save :

Traceback (most recent call last): File "X/threading.py", line 639, in _bootstrap_inner File "X/threading.py", line 596, in run File "phpcs in C:\Users\ben\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 433, in run File "phpcs in C:\Users\ben\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 139, in get_errors File "phpcs in C:\Users\ben\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 215, in execute File "phpcs in C:\Users\ben\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 218, in parse_report File "phpcs in C:\Users\ben\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 176, in shell_out UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 89: invalid start byte

I've looked for a fix but didn't find any, could you help me with this issue please?

here is my config file : { // Example for: // - Windows 7 // - With phpcs and php-cs-fixer support

// We want debugging on
"show_debug": true,

// Only execute the plugin for php files
"extensions_to_execute": ["php"],

// Do not execute for twig files
"extensions_to_blacklist": ["twig.php"],

// 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,

// Path to php on windows installation
// This is needed as we cannot run phars on windows, so we run it through php
"phpcs_php_prefix_path": "C:\\Program Files\\wamp\\bin\\php\\php5.5.12\\php.exe",

// We want the fixer to be run through the php application
"phpcs_commands_to_php_prefix": ["Fixer"],

// PHP_CodeSniffer settings
// Yes, run the phpcs command
"phpcs_sniffer_run": true,

// And execute it on save
"phpcs_command_on_save": true,

// This is the path to the bat file when we installed PHP_CodeSniffer
"phpcs_executable_path": "C:\\Program Files\\wamp\\bin\\php\\php5.5.12\\phpcs.bat",

// I want to run the PSR2 standard, and ignore warnings
"phpcs_additional_args": {
    "--standard": "PSR2",
    "-n": ""
},

// PHP-CS-Fixer settings
// Don't want to auto fix issue with php-cs-fixer
"php_cs_fixer_on_save": false,

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

// The fixer phar file is stored here:
"php_cs_fixer_executable_path": "C:\\Program Files\\wamp\\bin\\php\\php5.5.12\\php-cs-fixer.phar",

// Additional arguments, run all levels of fixing
"php_cs_fixer_additional_args": {
    "--level": "all"
},

// PHP Linter settings
// Yes, lets lint the files
"phpcs_linter_run": true,

// And execute that on each file when saved (php only as per extensions_to_execute)
"phpcs_linter_command_on_save": true,

// Path to php
"phpcs_php_path": "C:\\Program Files\\wamp\\bin\\php\\php5.5.12\\php.exe",

// This is the regex format of the errors
"phpcs_linter_regex": "(?P<message>.*) on line (?P<line>\\d+)",

// PHP Mess Detector settings
// Not turning on the mess detector here
"phpmd_run": false,
"phpmd_command_on_save": false,
"phpmd_executable_path": "",
"phpmd_additional_args": {}

}

Thanks a lot, Ben.

benmatselby commented 10 years ago

Can you paste in your console output please when trying to run this. I no longer have access to a windows machine, so need a little more information to see if I can figure out what might cause this. I assume it all works when you run on the command line as well right? If so can you paste that into here as well please

kafein-ben commented 10 years ago

Hi Ben, thank you for your support and sorry for this very late answer. I've had some OS issues and reinstalled everything, and, as it often happens, I don't have any more problems with the plugin. thanks again for the plugin, it's great!

Ben.

benmatselby commented 10 years ago

No worries, thanks for letting me know