alpm_lint/
level.rs

1use clap::ValueEnum;
2use serde::{Deserialize, Serialize};
3use strum::{Display as StrumDisplay, VariantArray};
4
5/// Represents the severity level of a lint.
6///
7/// The level of a lint can be overwritten via CLI flags and configuration files.
8#[derive(
9    Clone,
10    Copy,
11    Debug,
12    Deserialize,
13    PartialEq,
14    PartialOrd,
15    Serialize,
16    StrumDisplay,
17    ValueEnum,
18    VariantArray,
19)]
20#[strum(serialize_all = "lowercase")]
21pub enum Level {
22    /// Lint rules leading to errors.
23    ///
24    /// Lint rules with this severity level are used when encountering broken or invalid data.
25    Error = 1,
26    /// Lint rules leading to denials.
27    ///
28    /// Lint rules with this severity level always represent bad practices or severe errors.
29    Deny = 2,
30    /// Lint rules leading to warnings.
31    ///
32    /// Lint rules with this severity level indicate a mistake or misconfiguration and are
33    /// considered to be detectable with a high degree of certainty.
34    Warn = 3,
35    /// Lint rules leading to suggestions.
36    ///
37    /// Lint rules with this severity level are used to suggest best practices, which when not
38    /// followed do not lead to functional issues.
39    Suggest = 4,
40}