@@ -286,6 +286,11 @@ impl Diagnostic {
286286 self . inner . severity
287287 }
288288
289+ /// Sets the severity of this diagnostic.
290+ pub fn set_severity ( & mut self , severity : Severity ) {
291+ Arc :: make_mut ( & mut self . inner ) . severity = severity;
292+ }
293+
289294 /// Returns a shared borrow of the "primary" annotation of this diagnostic
290295 /// if one exists.
291296 ///
@@ -1098,6 +1103,9 @@ pub enum DiagnosticId {
10981103 /// Use of an invalid command-line option.
10991104 InvalidCliOption ,
11001105
1106+ /// The configured diagnostic baseline is invalid.
1107+ InvalidBaseline ,
1108+
11011109 /// Experimental feature requires preview mode.
11021110 PreviewFeature ,
11031111
@@ -1156,6 +1164,7 @@ impl DiagnosticId {
11561164 DiagnosticId :: UnsupportedPythonVersion => "unsupported-python-version" ,
11571165 DiagnosticId :: Unformatted => "unformatted" ,
11581166 DiagnosticId :: InvalidCliOption => "invalid-cli-option" ,
1167+ DiagnosticId :: InvalidBaseline => "invalid-baseline" ,
11591168 DiagnosticId :: PreviewFeature => "preview-feature" ,
11601169 DiagnosticId :: InternalError => "internal-error" ,
11611170 }
@@ -1327,6 +1336,7 @@ impl From<crate::files::FileRange> for Span {
13271336#[ cfg_attr( feature = "serde" , derive( Serialize ) ) ]
13281337#[ cfg_attr( feature = "serde" , serde( rename_all = "lowercase" ) ) ]
13291338pub enum Severity {
1339+ Hint ,
13301340 Info ,
13311341 Warning ,
13321342 Error ,
@@ -1336,7 +1346,7 @@ pub enum Severity {
13361346impl Severity {
13371347 fn to_annotate ( self ) -> AnnotateLevel < ' static > {
13381348 match self {
1339- Severity :: Info => AnnotateLevel :: INFO ,
1349+ Severity :: Hint | Severity :: Info => AnnotateLevel :: INFO ,
13401350 Severity :: Warning => AnnotateLevel :: WARNING ,
13411351 Severity :: Error => AnnotateLevel :: ERROR ,
13421352 // NOTE: Should we really collapse this to "error"?
0 commit comments