mirror of https://github.com/astral-sh/ruff
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
|
|
@ -674,6 +674,10 @@ impl Severity {
|
||||||
Severity::Fatal => AnnotateLevel::Error,
|
Severity::Fatal => AnnotateLevel::Error,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const fn is_fatal(self) -> bool {
|
||||||
|
matches!(self, Severity::Fatal)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configuration for rendering diagnostics.
|
/// Configuration for rendering diagnostics.
|
||||||
|
|
|
||||||
|
|
@ -306,6 +306,10 @@ impl MainLoop {
|
||||||
if diagnostics_count > 1 { "s" } else { "" }
|
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() {
|
if self.watcher.is_none() {
|
||||||
return Ok(match max_severity {
|
return Ok(match max_severity {
|
||||||
Severity::Info => ExitStatus::Success,
|
Severity::Info => ExitStatus::Success,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue