1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Merge pull request #8709 from kkmuffme/add-psalter-no-progress-flag

add --no-progress to psalter
This commit is contained in:
orklah 2022-11-15 20:20:17 +01:00 committed by GitHub
commit 12f33faece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ use Psalm\Internal\Scanner\ParsedDocblock;
use Psalm\IssueBuffer;
use Psalm\Progress\DebugProgress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
use Psalm\Report;
use Psalm\Report\ReportOptions;
@ -86,7 +87,8 @@ final class Psalter
'find-unused-code', 'threads:', 'codeowner:',
'allow-backwards-incompatible-changes:',
'add-newline-between-docblock-annotations:',
'no-cache'
'no-cache',
'no-progress'
];
/** @param array<int,string> $argv */
@ -130,6 +132,9 @@ final class Psalter
-m, --monochrome
Enable monochrome output
--no-progress
Disable the progress indicator
-r, --root
If running Psalm globally you'll need to specify a project root. Defaults to cwd
@ -257,9 +262,13 @@ final class Psalter
}
$debug = array_key_exists('debug', $options) || array_key_exists('debug-by-line', $options);
$progress = $debug
? new DebugProgress()
: new DefaultProgress();
if ($debug) {
$progress = new DebugProgress();
} elseif (isset($options['no-progress'])) {
$progress = new VoidProgress();
} else {
$progress = new DefaultProgress();
}
$stdout_report_options = new ReportOptions();
$stdout_report_options->use_color = !array_key_exists('m', $options);