Make WordPress Core

Ticket #43776: 43776-wpcs-ruleset-adjustment.patch

File 43776-wpcs-ruleset-adjustment.patch, 1.4 KB (added by jrf, 7 years ago)
  • phpcs.xml.dist

    From 8c68dc2a30aeb8b299513e85ae74b18cb16001d9 Mon Sep 17 00:00:00 2001
    From: jrfnl <663378+jrfnl@users.noreply.github.com>
    Date: Sun, 15 Apr 2018 14:03:28 +0300
    Subject: [PATCH] WPCS ruleset: Remove reference to GlobalVariables sniff
    
    This sniff is not included in the `WordPress-Core` ruleset as Core writing to Core global variables is fine (of course).
    Passing the custom properties which are needed by themes and plugins, activates the sniff needlessly.
    ---
     phpcs.xml.dist | 5 -----
     1 file changed, 5 deletions(-)
    
    diff --git a/phpcs.xml.dist b/phpcs.xml.dist
    index 9bcb15b3ef..e119e13d08 100644
    a b  
    8282                        <property name="custom_test_class_whitelist" type="array" value="WP_UnitTestCase,WP_Ajax_UnitTestCase,WP_Canonical_UnitTestCase,WP_Test_REST_TestCase,WP_Test_REST_Controller_Testcase,WP_Test_REST_Post_Type_Controller_Testcase,WP_XMLRPC_UnitTestCase"/>
    8383                </properties>
    8484        </rule>
    85         <rule ref="WordPress.Variables.GlobalVariables">
    86                 <properties>
    87                         <property name="custom_test_class_whitelist" type="array" value="WP_UnitTestCase,WP_Ajax_UnitTestCase,WP_Canonical_UnitTestCase,WP_Test_REST_TestCase,WP_Test_REST_Controller_Testcase,WP_Test_REST_Post_Type_Controller_Testcase,WP_XMLRPC_UnitTestCase"/>
    88                 </properties>
    89         </rule>
    9085
    9186        <!-- Exclude the unit tests from select sniffs. -->
    9287        <rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">