pub const DEFAULT_TEMPLATE: &str = include_str!("../../assets/default_template.md");
pub const CONFIG_LINT_PLUGIN: &str = include_str!("../../assets/config_lint.yml");
pub const CONFIG_LINT_URL: &str =
"https://raw.githubusercontent.com/nickderobertis/llmlint/main/assets/config_lint.yml";
pub const INIT_CONFIG: &str = include_str!("../../assets/init.llmlint.yml");
pub fn bundled_url(url: &str) -> Option<&'static str> {
if url == CONFIG_LINT_URL {
Some(CONFIG_LINT_PLUGIN)
} else {
None
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn bundled_url_resolves_config_lint() {
assert_eq!(bundled_url(CONFIG_LINT_URL), Some(CONFIG_LINT_PLUGIN));
assert!(bundled_url("https://example.com/other.yml").is_none());
}
#[test]
fn embedded_assets_are_non_empty() {
assert!(DEFAULT_TEMPLATE.contains("{% for r in rules %}"));
assert!(CONFIG_LINT_PLUGIN.contains("name_matches_description"));
assert!(INIT_CONFIG.contains("config_lint.yml"));
assert!(INIT_CONFIG.contains("plugins:"));
}
}