Closed kokokurak closed 9 years ago
So if you run phpcs ThisFile.php
on a file with above content it will hang? Same happens with PHP_CodeSniffer 2.3 version was well?
@aik099 I'm using the newest PHP_CodeSniffer available in Homebrew, which is 2.3.2.
It doesn't hang when I run just phpcs file.php
, but it hangs with phpcs --report=checkstyle --standard=PSR2 file.php
I'm not sure if it's directly related to PHP_CodeSniffer or the linter. Please let me know.
I just checked and phpcs --standard=PSR2 file.php
(without the report) causes the problem too.
PSR-1 runs just fine: phpcs --standard=PSR1 file.php
This is fixed in the current master version and will be released in the next version. The original issue is this one: https://github.com/squizlabs/PHP_CodeSniffer/issues/580
Ideally, PHPCS wouldn't be called on files that contain syntax errors, but I've added a bunch more guard code to make sure PHPCS doesnt break if it does encounter files like this.
Please have a go of the master version if you can.
When will the next version be released?
You know, using PHPCS "only on files without syntax errors" is not always possible, I think for the tool like this, working with invalid PHP files is a must.
When will the next version be released?
Ideally sometime before the 19th of June or I'm going to get really busy again.
You know, using PHPCS "only on files without syntax errors" is not always possible, I think for the tool like this, working with invalid PHP files is a must.
Hence all my testing and commits. We don't disagree.
Great, I can't wait. I use PHPCS with SublimeText all the time :)
Looks like this now works with 2.4
Yes I think it's fixed. I haven't experienced this problem for quite a bit. My fans are quiet :)
The problem occurs again after the update. I'm sure it's because of phpcs
- I disabled it in Sublime Text and there's no problem anymore.
@kokokurak It's probably just another syntax error that is causing the problem. The constant checking of plugins on unsaved files caused this problem, so I need more examples to find more of the problems. If you have a code snippet that causes the problem, please open a new issue and I'll get it fixed up.
@kokokurak alternatively you can switch lint mode from background to load/save as a workaround for now.
As mentioned here: https://github.com/SublimeLinter/SublimeLinter-php/issues/12
Sometimes, phpcs command opens php process that uses 100% CPU. We found out that it occurs when you test following code:
I haven't found any other cases so far.
It's a huge problem when I use real-time sniffing, it always opens such process when I just open new
foreach
loop and my fan begins to dance.