Make WordPress Core

Changeset 47207 for trunk/phpcs.xml.dist


Ignore:
Timestamp:
02/07/2020 07:14:29 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Adjust coding standards to always omit parentheses for include/require statements.

These are language constructs, not function calls, so the parentheses are unnecessary.

This updates the PHPCS configuration file the enforce the sniff until it is moved from the WordPress-Extra ruleset to the WordPress-Core ruleset upstream.

Follow-up to [47198].

Props desrosj, jrf, GaryJ.
Fixes #49376.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcs.xml.dist

    r47122 r47207  
    170170
    171171    <!-- Whitelist the I18n functions file from issues identified by the I18n sniff
    172         (such as calling the low-level translate() function). -->
     172         (such as calling the low-level translate() function). -->
    173173    <rule ref="WordPress.WP.I18n">
    174174        <exclude-pattern>/src/wp-includes/l10n\.php</exclude-pattern>
     
    190190
    191191    <!-- Exclude checking of line endings when reporting errors, but fix them when running phpcbf.
    192         Git and SVN manage these pretty well cross-platform as "native".
    193         Whitelist configuration files. -->
     192         Git and SVN manage these pretty well cross-platform as "native".
     193         Whitelist configuration files. -->
    194194    <rule ref="Generic.Files.LineEndings">
    195195        <exclude-pattern>/wp-config\.php</exclude-pattern>
     
    271271    </rule>
    272272
     273    <!-- Enforce no parenthesis for language constructs, and only one space immediately after.
     274         Including this rule is temporary until it is moved from the WordPress-Extra ruleset to
     275         the WordPress-Core ruleset upstream.
     276    -->
     277    <rule ref="PEAR.Files.IncludingFile.BracketsNotRequired">
     278        <type>warning</type>
     279    </rule>
     280    <rule ref="PEAR.Files.IncludingFile.UseRequire">
     281        <type>warning</type>
     282    </rule>
     283    <rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
     284        <type>warning</type>
     285    </rule>
     286    <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
     287
    273288    <!-- Assignments in while conditions are a valid method of looping over iterables. -->
    274289    <rule ref="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition">
Note: See TracChangeset for help on using the changeset viewer.