1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Use the long progress bar for CI logs (#2364)

This commit is contained in:
Tyson Andre 2019-11-22 08:56:18 -05:00 committed by Matthew Brown
parent cff354ef28
commit 6bc152e2da
2 changed files with 11 additions and 2 deletions

View File

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

View File

@ -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'])) {