#![allow(dead_code)]
pub mod gitlab;
pub mod html;
pub mod junit;
pub mod sarif;
pub use gitlab::generate_gitlab;
#[allow(unused_imports)] pub use html::generate_html;
pub use junit::generate_junit;
use serde::Serialize;
pub trait Reportable {
fn to_text(&self) -> String;
fn to_json(&self) -> anyhow::Result<String>;
fn to_sarif(&self) -> anyhow::Result<String>;
}
#[derive(Debug, Clone, Serialize)]
pub struct Report<T: Serialize> {
pub tool: String,
pub version: String,
pub timestamp: String,
pub data: T,
}
impl<T: Serialize> Report<T> {
pub fn new(data: T) -> Self {
Self {
tool: "mcplint".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
timestamp: chrono::Utc::now().to_rfc3339(),
data,
}
}
}