From 7e69921a5a2e097eb40c66180c6b49107b7f5067 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 19 Sep 2019 15:00:14 +0000 Subject: [PATCH] Build/Test Tools: Improvements to Composer scripts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. git-svn-id: https://develop.svn.wordpress.org/trunk@46187 602fd350-edb4-49c9-b593-d223f7449a82 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c795607093..2020779623 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,8 @@ "wp-coding-standards/wpcs": "~2.1.0" }, "scripts": { - "format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source --cache -d memory_limit=256M", - "lint": "phpcs --standard=phpcs.xml.dist --report-summary --report-source --cache -d memory_limit=256M", - "lint:errors": "phpcs --standard=phpcs.xml.dist --report-summary --report-source --cache -d memory_limit=256M -n" + "format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source --cache -d memory_limit=256M", + "lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary,source --cache -d memory_limit=256M", + "lint:errors": "@lint -n" } }