Make WordPress Core

Changeset 46187


Ignore:
Timestamp:
09/19/2019 03:00:14 PM (5 years ago)
Author:
desrosj
Message:

Build/Test Tools: Improvements to Composer scripts.

Prefixing a script command with @php ensures that the script runs with the same version of PHP that Composer is installed with (and not the system default).

This change also updates the phpcs and phpcbf commands to use the version of PHPCS installed by Composer.

The —standard is no longer explicitly passed to the command. By default, PHPCS will look for phpcs.xml.dist, which is the name of the custom standards file currently in Core.

Props dingo_d, jrf.
Fixes #47853.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/composer.json

    r45665 r46187  
    1515    },
    1616    "scripts": {
    17         "format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source --cache -d memory_limit=256M",
    18         "lint": "phpcs --standard=phpcs.xml.dist --report-summary --report-source --cache -d memory_limit=256M",
    19         "lint:errors": "phpcs --standard=phpcs.xml.dist --report-summary --report-source --cache -d memory_limit=256M -n"
     17        "format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source --cache -d memory_limit=256M",
     18        "lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary,source --cache -d memory_limit=256M",
     19        "lint:errors": "@lint -n"
    2020    }
    2121}
Note: See TracChangeset for help on using the changeset viewer.