5

I want to see only error in codesniffer. Because file have too many warning and i have only correct the errors. Can any know how to to do that?

6
  • Why not fix the warnings? They're violating the defined set of coding standards for that project anyway.
    – ʰᵈˑ
    Dec 9, 2016 at 9:53
  • @ʰᵈˑ i have only advised to fix the errors because fixing warning may caused the functionality problem. that take too much time to fix. Dec 9, 2016 at 9:55
  • In CodeSniffer.conf, is show_warnings set to 0?
    – ʰᵈˑ
    Dec 9, 2016 at 10:04
  • CodeSniffer.conf.dist added this but not working <?php $phpCodeSnifferConfig = array ( 'default_standard' => 'MEQP1', 'report_format' => 'summary', 'show_warnings' => '0', 'show_progress' => '1', 'report_width' => '120', ) ?> Dec 9, 2016 at 10:09
  • 2
    If you don't want warnings, use the -n option : github.com/squizlabs/PHP_CodeSniffer/wiki/… Dec 11, 2016 at 4:13

2 Answers 2

8

Thanks @GregSherwood following this link

phpcs -n --standard=MEQP1 pathtofile
0

Another possible solution would be.

phpcs -n --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md pathtofile

Replace pathtofile with the file or directory of your own.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.