Skip to content

Commit

Permalink
Composer: various tweaks
Browse files Browse the repository at this point in the history
This commit adds two additional scripts and adjusts the existing one.

The additional scripts are just shortcuts to run `phpcs` and `phpcbf`.

The more important change is how the scripts are run - using the `@php` prefix ensures that the scripts are run against the same PHP version as with which Composer is called, instead of against the system default PHP version.

This is important if - as a WPCS dev - you change the PHP version for Composer to be able to test things against different PHP versions.

Ref: composer/composer#7645
  • Loading branch information
jrfnl committed Sep 16, 2018
1 parent 233195f commit 31541fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
},
"type" : "phpcodesniffer-standard",
"scripts" : {
"install-codestandards": "\"vendor/bin/phpcs\" --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility",
"post-install-cmd": "@install-codestandards",
"post-update-cmd" : "@install-codestandards"
"install-codestandards": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility",
"check-cs" : "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs",
"fix-cs" : "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf",
"post-install-cmd" : "@install-codestandards",
"post-update-cmd" : "@install-codestandards"
}
}

0 comments on commit 31541fb

Please sign in to comment.