use crate::checkstyle::api::violation::Violation;
use std::path::PathBuf;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum SeverityLevel {
Ignore,
Info,
Warning,
Error,
}
impl Default for SeverityLevel {
fn default() -> Self {
Self::Error
}
}
#[derive(Debug, Clone)]
pub struct AuditEvent {
pub file: Option<PathBuf>,
pub violation: Option<Violation>,
pub event_type: AuditEventType,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AuditEventType {
AuditStarted,
AuditFinished,
FileStarted,
FileFinished,
AddError,
AddException,
}
impl AuditEvent {
pub fn new(
file: Option<PathBuf>,
violation: Option<Violation>,
event_type: AuditEventType,
) -> Self {
Self {
file,
violation,
event_type,
}
}
}