fix(config): Don't treat ts as typoscript

Fixes #911
This commit is contained in:
Ed Page 2024-01-19 10:26:22 -06:00
parent d543202e5b
commit fe1a73ca8a

View file

@ -261,7 +261,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
("ts", &["*.ts", "*.tsx"]), ("ts", &["*.ts", "*.tsx"]),
("twig", &["*.twig"]), ("twig", &["*.twig"]),
("txt", &["*.txt"]), ("txt", &["*.txt"]),
("typoscript", &["*.typoscript", "*.ts"]), ("typoscript", &["*.typoscript"]),
("vala", &["*.vala"]), ("vala", &["*.vala"]),
("vb", &["*.vb"]), ("vb", &["*.vb"]),
("vcl", &["*.vcl"]), ("vcl", &["*.vcl"]),
@ -292,3 +292,20 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]), ]),
("zstd", &["*.zst", "*.zstd"]), ("zstd", &["*.zst", "*.zstd"]),
]; ];
// See `cargo test --lib -- --nocapture default_types::check_duplicates`
#[test]
fn check_duplicates() {
let mut reverse = std::collections::BTreeMap::new();
for (name, exts) in DEFAULT_TYPES {
for ext in *exts {
reverse.entry(ext).or_insert(Vec::new()).push(name);
}
}
for (ext, names) in reverse {
if 1 < names.len() {
println!("{ext} is under multiple names: {names:?}");
}
}
}