mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
Show a warning at the end of the diagnostic list if there are any fatal warnings (#17855)
This commit is contained in:
parent
d410d12bc5
commit
6f821ac846
2 changed files with 8 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue