composer list で表示される一覧に説明文をつける
Custom descriptions | Scripts – Composer
scripts-descriptions
を定義すればOK。
1 2 3 4 5 6 7 8 9 |
{ "scripts": { "test": "phpunit" } "scripts-descriptions": { "test": "Run all tests!" } } |
タイムアウトを調整する
デフォルトでは300secなので、Codeceptionの受け入れテスト等、時間のかかるスクリプトは以下のようなタイムアウトエラーが出る。
1 2 3 4 |
[Symfony\Component\Process\Exception\ProcessTimedOutException] The process "codecept run" exceeded the timeout of 300 seconds. |
run-scriptコマンドのオプション--timeout
、または環境変数のCOMPOSER_PROCESS_TIMEOUTを使用する。
1 2 3 4 5 6 7 8 9 10 11 12 |
# OK composer run-script test --timeout=0 # OK runはrun-scriptの短縮形 composer run test --timeout=0 # NG timeoutオプションを指定する場合は、run-scriptを省略することはできない composer test --timeout=0 # OK 環境変数のCOMPOSER_PROCESS_TIMEOUTを使用してもよい COMPOSER_PROCESS_TIMEOUT=1 composer test |
composer.jsonにprocess-timeoutを設定してもよいが、こちらはrun-script以外にもinstallやupdate等、composerコマンド全体で使用されるので注意。
呼び出しコマンドにオプションを渡す
--
の後に呼び出しコマンドに追加したいオプションを書く
1 2 3 |
# "cs-check": "phpcs" のとき以下で phpcs -n src/ の実行となる composer cs-check -- -n src/ |