Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --no-progress to psalter #8709

Merged
merged 2 commits into from Nov 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you seem to be missing an import for VoidProgress here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, added.

In v4 circleci would have complained about that, is there maybe a bug with it in v5?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's classified as Code Style issue given it was an outright bug (Can php cs even know this class does not exists in this namespace??)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 99.9% sure it previously complained for missing "use" statements in 4.x branch

} else {
$progress = new DefaultProgress();
}

$stdout_report_options = new ReportOptions();
$stdout_report_options->use_color = !array_key_exists('m', $options);
Expand Down