WordPress.org

Make WordPress Core

Changeset 46291


Ignore:
Timestamp:
09/25/2019 02:01:51 PM (2 months ago)
Author:
desrosj
Message:

Build/Test Tools: Move Composer script command line directives to the PHPCS ruleset.

Also, move all arguments up to the top of the custom ruleset to make it easier to understand the conditions the ruleset is run under.

Props desrosj, jrf.
See #46152.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/composer.json

    r46290 r46291  
    2020    "scripts": {
    2121        "compat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcompat.xml.dist --report=summary,source",
    22         "format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source --cache -d memory_limit=256M",
    23         "lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary,source --cache -d memory_limit=256M",
     22        "format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source",
     23        "lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary,source",
    2424        "lint:errors": "@lint -n"
    2525    }
  • trunk/phpcs.xml.dist

    r45665 r46291  
    22<ruleset name="WordPress Coding Standards">
    33    <description>Apply WordPress Coding Standards to all Core files</description>
     4
     5    <!-- Only scan PHP files. -->
     6    <arg name="extensions" value="php"/>
     7
     8    <!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
     9    <arg name="cache"/>
     10
     11    <!-- Set the memory limit to 256M.
     12         For most standard PHP configurations, this means the memory limit will temporarily be raised.
     13         Ref: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#specifying-phpini-settings
     14    -->
     15    <ini name="memory_limit" value="256M"/>
     16
     17    <!-- Strip the filepaths down to the relevant bit. -->
     18    <arg name="basepath" value="./"/>
     19
     20    <!-- Check up to 20 files simultaneously. -->
     21    <arg name="parallel" value="20"/>
     22
     23    <!-- Show sniff codes in all reports -->
     24    <arg value="ps"/>
     25
     26    <file>.</file>
    427
    528    <rule ref="WordPress-Core"/>
     
    77100    </rule>
    78101
    79     <arg name="extensions" value="php"/>
    80 
    81     <!-- Strip the filepaths down to the relevant bit. -->
    82     <arg name="basepath" value="./"/>
    83 
    84     <!-- Check up to 20 files simultaneously. -->
    85     <arg name="parallel" value="20"/>
    86 
    87     <!-- Show sniff codes in all reports -->
    88     <arg value="ps"/>
    89 
    90     <file>.</file>
    91 
    92102    <!-- Exclude the build folder in the current directory, as Travis puts the checkout in a build directory. -->
    93103    <exclude-pattern type="relative">^build/*</exclude-pattern>
Note: See TracChangeset for help on using the changeset viewer.