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.

git-svn-id: https://develop.svn.wordpress.org/trunk@46187 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2019-09-19 15:00:14 +00:00
parent 84dfea907f
commit 7e69921a5a

View File

@ -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"
}
}