phpcs has an option to output the "sniff codes" of the violations that occur. This is very helpful to pinpoint the exact sniff that has thrown a warning. It would be nice to pass through this option.

$ phpcs --help       
Usage: phpcs [-nwlsaepvi] [-d key[=value]]
        ...
        -s            Show sniff codes in all reports
$ phpcs --standard=Drupal -s .
FILE: ...odules/paddle_editorial_notes/paddle_editorial_notes.features.field.inc
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 3 WARNING(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
  13 | WARNING | Line exceeds 80 characters; contains 81 characters
     |         | (Drupal.Files.LineLength.TooLong)
--------------------------------------------------------------------------------
CommentFileSizeAuthor
#1 2106375-1-coder-show-sniffs.patch879 bytespfrenssen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pfrenssen’s picture

Status: Active » Needs review
FileSize
879 bytes

Here is a patch that passes through the option "drush dcs --show-sniffs" to phpcs.

pfrenssen’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev

The patch is identical for 7.x-2.x and 8.x-2.x. Let's apply it to 8.x first.

klausi’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

running with drush is not supported anymore, just use phpcs with -s.