From 6bc152e2da855d9e3cc9d0676e3dbad127ce0dd3 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Fri, 22 Nov 2019 08:56:18 -0500 Subject: [PATCH] Use the long progress bar for CI logs (#2364) --- src/command_functions.php | 3 +++ src/psalm.php | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/command_functions.php b/src/command_functions.php index c25db7fea..8fd79eb55 100644 --- a/src/command_functions.php +++ b/src/command_functions.php @@ -376,6 +376,9 @@ Options: --no-progress Disable the progress indicator + --long-progress + Use a progress indicator suitable for Continuous Integration logs + --alter Run Psalter diff --git a/src/psalm.php b/src/psalm.php index ba0f15951..df1e20e8a 100644 --- a/src/psalm.php +++ b/src/psalm.php @@ -8,6 +8,7 @@ use Psalm\Config; use Psalm\IssueBuffer; use Psalm\Progress\DebugProgress; use Psalm\Progress\DefaultProgress; +use Psalm\Progress\LongProgress; use Psalm\Progress\VoidProgress; // show all errors @@ -62,6 +63,7 @@ $valid_long_options = [ 'refactor', 'shepherd::', 'no-progress', + 'long-progress', 'include-php-versions', // used for baseline 'track-tainted-input', 'find-unused-psalm-suppress', @@ -414,7 +416,7 @@ if (isset($_SERVER['TRAVIS']) || isset($_SERVER['GITLAB_CI']) || isset($_SERVER['GITHUB_WORKFLOW']) ) { - $options['no-progress'] = true; + $options['long-progress'] = true; } $debug = array_key_exists('debug', $options) || array_key_exists('debug-by-line', $options); @@ -425,7 +427,11 @@ if ($debug) { $progress = new VoidProgress(); } else { $show_errors = !$config->error_baseline || isset($options['ignore-baseline']); - $progress = new DefaultProgress($show_errors, $show_info); + if (isset($options['long-progress'])) { + $progress = new LongProgress($show_errors, $show_info); + } else { + $progress = new DefaultProgress($show_errors, $show_info); + } } if (isset($options['no-cache'])) {