mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-06 00:20:37 +00:00
Add progress bar for ty check
(#17965)
## Summary Adds a simple progress bar for the `ty check` CLI command. The style is taken from uv, and like uv the bar is always shown - for smaller projects it is fast enough that it isn't noticeable. We could alternatively hide it completely based on some heuristic for the number of files, or only show it after some amount of time. I also disabled it when `--watch` is passed, cancelling inflight checks was leading to zombie progress bars. I think we can fix this by using [`MultiProgress`](https://docs.rs/indicatif/latest/indicatif/struct.MultiProgress.html) and managing all the bars globally, but I left that out for now. Resolves https://github.com/astral-sh/ty/issues/98.
This commit is contained in:
parent
25e13debc0
commit
e9da1750a1
9 changed files with 103 additions and 35 deletions
|
@ -18,8 +18,8 @@ use ty_ide::{goto_type_definition, hover, inlay_hints, MarkupKind};
|
|||
use ty_project::metadata::options::Options;
|
||||
use ty_project::metadata::value::ValueSource;
|
||||
use ty_project::watch::{ChangeEvent, ChangedKind, CreatedKind, DeletedKind};
|
||||
use ty_project::ProjectMetadata;
|
||||
use ty_project::{Db, ProjectDatabase};
|
||||
use ty_project::{DummyReporter, ProjectMetadata};
|
||||
use ty_python_semantic::Program;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
|
@ -186,7 +186,7 @@ impl Workspace {
|
|||
|
||||
/// Checks all open files
|
||||
pub fn check(&self) -> Result<Vec<Diagnostic>, Error> {
|
||||
let result = self.db.check().map_err(into_error)?;
|
||||
let result = self.db.check(&DummyReporter).map_err(into_error)?;
|
||||
|
||||
Ok(result.into_iter().map(Diagnostic::wrap).collect())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue