Make WordPress Core

Ticket #46869: 46869.diff

File 46869.diff, 1.8 KB (added by azaozz, 6 years ago)
  • phpcs.xml.dist

     
    187187                <exclude-pattern>/tests/phpunit/tests/*</exclude-pattern>
    188188        </rule>
    189189
     190        <!-- Abide by the exception to the WordPress Coding Standards for (optional) addition of white space before the equal sign.
     191                See https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#indentation.
     192                Limit the number of spaces used for padding when aligning equal signs. -->
     193        <rule ref="Generic.Formatting.MultipleStatementAlignment">
     194                <properties>
     195                        <property name="maxPadding" value="8" />
     196                </properties>
     197        </rule>
     198
     199        <!-- Do not align the `=>` in the "top" level(s) of multi-dimensional associative arrays.
     200                This keeps these code blocks more readable. -->
     201        <rule ref="WordPress.Arrays.MultipleStatementAlignment">
     202                <properties>
     203                        <property name="alignMultilineItems" value="never" />
     204                </properties>
     205        </rule>
     206
     207        <!-- Lower the severity of DoubleArrowNotAligned. In some cases it is incompatible with the generic rule.
     208                Add `warning-severity=4` to the command line to enable. -->
     209        <rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned">
     210                <severity>4</severity>
     211        </rule>
     212
     213        <!-- Lower the severity of SpacesAroundArrayKeys. The JS coding standards were updated to allow spaces around all array keys.
     214                The PHP CS should follow that, as discussed. Add `error-severity=4` to the command line to enable. -->
     215        <rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys">
     216                <severity>4</severity>
     217        </rule>
     218
     219        <!-- Lower the severity of YodaConditions.NotYoda. Add `error-severity=1` to the command line to enable. -->
     220        <rule ref="WordPress.PHP.YodaConditions.NotYoda">
     221                <severity>1</severity>
     222        </rule>
     223
    190224</ruleset>