code sniffer not working

I have installed code sniffer alongside drupal/coder globally as per this guide: https://www.jetbrains.com/help/phpstorm/using-php-code-sniffer.html

 

I have pointed the local php/quality tools configuration to point at .composer/vendor/bin/phpcs, when I click the validate button it says ok and that version 3.4.0 of code sniffer is installed.

When I look at preferences > Inspections I have checked PHP Code Sniffer validation under quality tools and the settings in there have all been left at default apart from the coding standard which I have set to Drupal.

 

The problem is nothing happens in the editor, I have deliberately written some poorly formatted code to test and none of it is highlighted:

  $jimmy =0;
if ($jimmy ) {
print 'do shizzle';}
$jimmy = 1;
$jimmy = 1;



}

When I look in the event log I see no phpcs errors (or any other errors for that matter). What steps can I take to get this working?

 

0

What if you try to run Inspect Code manually, is there anything from "phpcs" in an output?

0
Avatar
Permanently deleted user

I've never used code sniffer before this week so am not sure how to run it manually, how do I do that?

0
Avatar
Permanently deleted user

Just realized it is kicking in for .php files but not .module files so perhaps this is a file association issue?

0
Avatar
Permanently deleted user

I can see the same issue, previously PHP CS has worked good. Now, nothing happened in my editor. When I run a code inspection by name, this message appears "No suspicious code found. 1 files processed in 'File "FileFormatter.php''."

But when I run PHP CS from the command line, a lot of warnings printing in my console.

1

Bump. This is still the case in recent 2019.2.4 - despite having errors, IntelijJ say "No suspicious code found. ...". Running by hand in console shows report as expected.

0

Thanks.

Typically those issues are caused by an incorrect config. We'll continue investigation in a bug report linked above.

0

请先登录再写评论。