diff --git a/crates/ruff_db/src/diagnostic/mod.rs b/crates/ruff_db/src/diagnostic/mod.rs index 023fc59368..b795911d6d 100644 --- a/crates/ruff_db/src/diagnostic/mod.rs +++ b/crates/ruff_db/src/diagnostic/mod.rs @@ -674,6 +674,10 @@ impl Severity { Severity::Fatal => AnnotateLevel::Error, } } + + pub const fn is_fatal(self) -> bool { + matches!(self, Severity::Fatal) + } } /// Configuration for rendering diagnostics. diff --git a/crates/ty/src/main.rs b/crates/ty/src/main.rs index 3167a24ad4..f0082f1824 100644 --- a/crates/ty/src/main.rs +++ b/crates/ty/src/main.rs @@ -306,6 +306,10 @@ impl MainLoop { if diagnostics_count > 1 { "s" } else { "" } )?; + if max_severity.is_fatal() { + tracing::warn!("A fatal occurred while checking some files. Not all project files were analyzed. See the diagnostics list above for details."); + } + if self.watcher.is_none() { return Ok(match max_severity { Severity::Info => ExitStatus::Success,