Skip to main content

ass_core/analysis/linting/
severity.rs

1//! Severity levels for lint issues.
2//!
3//! Defines [`IssueSeverity`], the ordered scale used to rank linting
4//! findings from informational hints up to critical errors.
5
6use core::fmt;
7
8/// Severity level for lint issues.
9#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
10pub enum IssueSeverity {
11    /// Informational message - no action required
12    Info,
13    /// Hint for improvement - optional fix
14    Hint,
15    /// Warning - should be addressed but not critical
16    Warning,
17    /// Error - must be fixed for proper functionality
18    Error,
19    /// Critical error - script may not work at all
20    Critical,
21}
22
23impl fmt::Display for IssueSeverity {
24    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
25        match self {
26            Self::Info => write!(f, "info"),
27            Self::Hint => write!(f, "hint"),
28            Self::Warning => write!(f, "warning"),
29            Self::Error => write!(f, "error"),
30            Self::Critical => write!(f, "critical"),
31        }
32    }
33}