Make WordPress Core

Changeset 56666


Ignore:
Timestamp:
09/23/2023 10:56:24 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Improve organization of the PHPCompatibility ruleset.

This commit:

  • Adds section headers to the ruleset file.
  • Organizes all directives in their respective sections.

No functional changes.

Props jrf.
See #58831.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcompat.xml.dist

    r56475 r56666  
    33        <description>Apply PHP compatibility checks to all WordPress Core files</description>
    44
    5         <rule ref="PHPCompatibilityWP"/>
    6 
    7         <!-- WordPress Core currently supports PHP 7.0+. -->
    8         <config name="testVersion" value="7.0-"/>
     5        <!--
     6        #############################################################################
     7        COMMAND LINE ARGUMENTS
     8        https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset
     9        #############################################################################
     10        -->
    911
    1012        <!-- Only scan PHP files. -->
     
    2931        <arg value="ps"/>
    3032
     33        <!--
     34        #############################################################################
     35        FILE SELECTION
     36        Set which files will be subject to the scans executed using this ruleset.
     37        #############################################################################
     38        -->
     39
    3140        <!-- For now, only the files in src are scanned. -->
    3241        <file>./src/</file>
     
    4150        <exclude-pattern>/vendor/*</exclude-pattern>
    4251
    43         <!-- Must-Use plugins. -->
     52        <!-- Exclude Must-Use plugins. -->
    4453        <exclude-pattern>/src/wp-content/mu-plugins/*</exclude-pattern>
    4554
    46         <!-- Plugins. -->
     55        <!-- Exclude plugins. -->
    4756        <exclude-pattern>/src/wp-content/plugins/*</exclude-pattern>
    4857
    49         <!-- Themes except the twenty* themes. -->
     58        <!-- Exclude themes except the twenty* themes. -->
    5059        <exclude-pattern>/src/wp-content/themes/(?!twenty)*</exclude-pattern>
    5160
     
    5564        -->
    5665        <exclude-pattern>src/wp-includes/sodium_compat/lib/php72compat_const\.php$</exclude-pattern>
     66
     67        <!--
     68        #############################################################################
     69        SET UP THE RULESET
     70        #############################################################################
     71        -->
     72
     73        <rule ref="PHPCompatibilityWP"/>
     74
     75        <!-- WordPress Core currently supports PHP 7.0+. -->
     76        <config name="testVersion" value="7.0-"/>
     77
     78        <!--
     79        #############################################################################
     80        SELECTIVE EXCLUSIONS
     81        Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.
     82        #############################################################################
     83        -->
    5784
    5885        <rule ref="PHPCompatibility.FunctionUse.NewFunctions.sodium_crypto_sign_keypair_from_secretkey_and_publickeyFound">
     
    82109                <exclude-pattern>/random_compat/random_bytes_mcrypt\.php$</exclude-pattern>
    83110        </rule>
     111
    84112</ruleset>
Note: See TracChangeset for help on using the changeset viewer.