use std::collections::BTreeMap;
use std::sync::LazyLock;
use serde::Deserialize;
use crate::config::RuleConfig;
use crate::config::StyleConfig;
pub static HEADERS: LazyLock<BTreeMap<&'static str, &'static str>> = LazyLock::new(|| {
BTreeMap::from([
("Apache-2.0", include_str!("headers/Apache-2.0.txt")),
("Apache-2.0-ASF", include_str!("headers/Apache-2.0-ASF.txt")),
("Elastic-2.0", include_str!("headers/Elastic-2.0.txt")),
])
});
pub static RULES: LazyLock<Vec<RuleConfig>> = LazyLock::new(|| {
#[derive(Deserialize)]
struct Rules {
rules: Vec<RuleConfig>,
}
let rules = toml::from_str::<Rules>(include_str!("rules.toml")).unwrap();
rules.rules
});
pub static STYLES: LazyLock<BTreeMap<String, StyleConfig>> = LazyLock::new(|| {
#[derive(Deserialize)]
struct Styles {
styles: BTreeMap<String, StyleConfig>,
}
let styles = toml::from_str::<Styles>(include_str!("styles.toml")).unwrap();
styles.styles
});