Skip to content

Commit 6c1d5fd

Browse files
oyarsameta-codesync[bot]
authored andcommitted
Add --no-progress-bar to hide progress bar (#2807)
Summary: Add `--no-progress-bar` flag to `pyrefly check` to hide progress bar. The goal is to show the summary without the progress bar. Fixes #2780 Pull Request resolved: #2807 Reviewed By: jvansch1 Differential Revision: D96755976 Pulled By: yangdanny97 fbshipit-source-id: 88702ef8d9e84cd105bd235567a3967cb91dc665
1 parent d83ab57 commit 6c1d5fd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pyrefly/lib/commands/check.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ struct OutputArgs {
281281
)]
282282
summary: Summary,
283283

284+
/// Suppress the progress bar during type checking.
285+
#[arg(long)]
286+
no_progress_bar: bool,
287+
284288
/// When specified, strip this prefix from any paths in the output.
285289
/// Pass "" to show absolute paths. When omitted, we will use the current working directory.
286290
#[arg(long)]
@@ -818,11 +822,13 @@ impl CheckArgs {
818822
let mut memory_trace = MemoryUsageTrace::start(Duration::from_secs_f32(0.1));
819823

820824
let type_check_start = Instant::now();
821-
if self.output.summary != Summary::None {
825+
let show_progress_bar =
826+
self.output.summary != Summary::None && !self.output.no_progress_bar;
827+
if show_progress_bar {
822828
transaction.set_subscriber(Some(Box::new(ProgressBarSubscriber::new())));
823829
}
824830
transaction.run(handles, require, None);
825-
if self.output.summary != Summary::None {
831+
if show_progress_bar {
826832
transaction.set_subscriber(None);
827833
}
828834

0 commit comments

Comments
 (0)