pub const CLI2_NAMES: [&str; 4] = [
".markdownlint-cli2.jsonc",
".markdownlint-cli2.yaml",
".markdownlint-cli2.cjs",
".markdownlint-cli2.mjs",
];
pub const LIBRARY_NAMES: [&str; 6] = [
".markdownlint.jsonc",
".markdownlint.json",
".markdownlint.yaml",
".markdownlint.yml",
".markdownlint.cjs",
".markdownlint.mjs",
];
pub fn discovery_names() -> impl Iterator<Item = &'static str> {
CLI2_NAMES.into_iter().chain(LIBRARY_NAMES)
}
pub const REPO: &str = "https://github.com/DavidAnson/markdownlint-cli2";
pub const REV: &str = "v0.24.0";
pub const RELATIVE_LINKS_PACKAGE: &str = "markdownlint-rule-relative-links";
pub const RELATIVE_LINKS_VERSION: &str = "5.1.3";
#[must_use]
pub fn relative_links_dependency() -> String {
format!("{RELATIVE_LINKS_PACKAGE}@{RELATIVE_LINKS_VERSION}")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn the_families_do_not_overlap_and_every_name_is_hidden() {
for name in discovery_names() {
assert!(name.starts_with(".markdownlint"), "{name}");
}
for name in CLI2_NAMES {
assert!(!LIBRARY_NAMES.contains(&name), "{name}");
}
assert_eq!(discovery_names().count(), 10);
}
#[test]
fn the_dependency_pins_the_version() {
assert_eq!(
relative_links_dependency(),
"markdownlint-rule-relative-links@5.1.3"
);
}
}