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?
Asked
Active
Viewed 4,913 times
5
-
Why not fix the warnings? They're violating the defined set of coding standards for that project anyway. – ʰᵈˑ Dec 09 '16 at 09:53
-
@ʰᵈˑ i have only advised to fix the errors because fixing warning may caused the functionality problem. that take too much time to fix. – Qaisar Satti Dec 09 '16 at 09:55
-
In `CodeSniffer.conf`, is `show_warnings` set to `0`? – ʰᵈˑ Dec 09 '16 at 10:04
-
**CodeSniffer.conf.dist** added this but not working ` 'MEQP1', 'report_format' => 'summary', 'show_warnings' => '0', 'show_progress' => '1', 'report_width' => '120', ) ?>` – Qaisar Satti Dec 09 '16 at 10:09
-
2If you don't want warnings, use the -n option : https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage#checking-files-and-folders – Greg Sherwood Dec 11 '16 at 04:13
-
@GregSherwood thanks – Qaisar Satti Dec 13 '16 at 06:21
2 Answers
8
Thanks @GregSherwood following this link
phpcs -n --standard=MEQP1 pathtofile

Qaisar Satti
- 2,742
- 2
- 18
- 36
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.

Naser Nikzad
- 713
- 12
- 27