From 2de7506f4cfd55d5827fd8fe2dbd0a4c3e72855e Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Thu, 6 Feb 2020 14:06:15 -0800 Subject: [PATCH 1/2] Enforce --no-colors in CI mode --- pretty | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pretty b/pretty index e68931c..bb3025b 100755 --- a/pretty +++ b/pretty @@ -27,8 +27,8 @@ $commands = [ */ 'ci' => [ 'php-cs-fixer' => 'php-cs-fixer fix --dry-run --allow-risky=yes --diff --using-cache=no', - 'phpcs' => 'phpcs --no-cache', - 'default' => 'phpcs --standard=PSR2 --extensions=php --ignore="vendor/*" --no-cache .', + 'phpcs' => 'phpcs --no-cache --no-colors', + 'default' => 'phpcs --standard=PSR2 --extensions=php --ignore="vendor/*" --no-cache --no-colors .', ], ]; @@ -88,7 +88,7 @@ function commandExists($command) if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $return = shell_exec('where ' . escapeshellarg($command)); } else { - $return = shell_exec('which ' . escapeshellarg($command)); + $return = shell_exec('which ' . escapeshellarg($command)); } return !empty($return); } From 1c15e29f842e7bc2e811dadce47de82cefbcc154 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 7 Feb 2020 13:36:30 -0800 Subject: [PATCH 2/2] Fixed the program detection based on the phpcs command --- pretty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pretty b/pretty index bb3025b..e8c2d70 100755 --- a/pretty +++ b/pretty @@ -52,7 +52,7 @@ $command = ''; if (file_exists('.phpcs.xml') || file_exists('phpcs.xml') || file_exists('.phpcs.xml.dist') || file_exists('phpcs.xml.dist')) { echo "PHP CodeSniffer configuration file found, running CodeSniffer with version\n"; $command = $commands['phpcs']; - $program = explode(' ', $command, 1)[0]; + $program = explode(' ', $command, 2)[0]; assertPhpCodeSnifferIsInstalled($program); passthru($program." --version");