mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:14:52 +00:00
convert errors to diagnostics too
This commit is contained in:
parent
a5ec195c53
commit
4ea16b7dd6
2 changed files with 99 additions and 7 deletions
|
@ -443,7 +443,9 @@ impl Diagnostic {
|
|||
| DiagnosticId::UnnecessaryOverridesSection
|
||||
| DiagnosticId::UselessOverridesSection
|
||||
| DiagnosticId::DeprecatedSetting
|
||||
| DiagnosticId::Unformatted => None,
|
||||
| DiagnosticId::Unformatted
|
||||
| DiagnosticId::RangeFormatNotebook
|
||||
| DiagnosticId::FormatError => None,
|
||||
DiagnosticId::Lint(lint_name) => {
|
||||
Some(format!("{}/rules/{lint_name}", env!("CARGO_PKG_HOMEPAGE")))
|
||||
}
|
||||
|
@ -1026,6 +1028,14 @@ pub enum DiagnosticId {
|
|||
|
||||
/// The code needs to be formatted.
|
||||
Unformatted,
|
||||
|
||||
/// Range formatting isn't supported for notebooks.
|
||||
RangeFormatNotebook,
|
||||
|
||||
/// Something went wrong while formatting.
|
||||
///
|
||||
/// This often indicates a bug in the formatter.
|
||||
FormatError,
|
||||
}
|
||||
|
||||
impl DiagnosticId {
|
||||
|
@ -1066,6 +1076,8 @@ impl DiagnosticId {
|
|||
DiagnosticId::UselessOverridesSection => "useless-overrides-section",
|
||||
DiagnosticId::DeprecatedSetting => "deprecated-setting",
|
||||
DiagnosticId::Unformatted => "unformatted",
|
||||
DiagnosticId::RangeFormatNotebook => "range-format-notebook",
|
||||
DiagnosticId::FormatError => "format-error",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue