Problem/Motivation

Coming from #2901739: Fix 'Squiz.Arrays.ArrayDeclaration' coding standard. We have two different ways of excluding sub-rules in core's phpcs.xml.dist:

  1.     <exclude name="Drupal.Commenting.ClassComment.Missing"/>
    
  2.   <rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
        <severity>0</severity>
      </rule>
    

We want core's phpcs.xml.dist to match the Drupal standard.

Proposed resolution

Prefer the "exclude" format, since it is less verbose and more readable. According to @mfernea there is not a difference between the two for our usecase.

Reference: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml

Update the ruleset to that end: http://cgit.drupalcode.org/coder/tree/coder_sniffer/Drupal/ruleset.xml

Remaining tasks

Once we've updated the coder standards, update core's phpcs.xml.dist to match: #2909268: Prefer "exclude" format over "severity 0" format in ruleset for readability once coder does

mfernea should receive credit for this issue.

Comments

xjm created an issue. See original summary.

xjm’s picture

Issue summary: View changes

Added a core followup.

xjm’s picture

Issue summary: View changes