Skip to content

Commit

Permalink
Merge pull request #8709 from kkmuffme/add-psalter-no-progress-flag
Browse files Browse the repository at this point in the history
add --no-progress to psalter
  • Loading branch information
orklah committed Nov 15, 2022
2 parents 22fe7f4 + ad90cc2 commit 12f33fa
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Psalm/Internal/Cli/Psalter.php
Expand Up @@ -21,6 +21,7 @@
use Psalm\IssueBuffer;
use Psalm\Progress\DebugProgress;
use Psalm\Progress\DefaultProgress;
use Psalm\Progress\VoidProgress;
use Psalm\Report;
use Psalm\Report\ReportOptions;

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -130,6 +132,9 @@ public static function run(array $argv): void
-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
Expand Down Expand Up @@ -257,9 +262,13 @@ public static function run(array $argv): void
}

$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);
Expand Down

0 comments on commit 12f33fa

Please sign in to comment.