mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-21 16:41:01 -05:00
parent
d543202e5b
commit
fe1a73ca8a
1 changed files with 18 additions and 1 deletions
|
@ -261,7 +261,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
|
|||
("ts", &["*.ts", "*.tsx"]),
|
||||
("twig", &["*.twig"]),
|
||||
("txt", &["*.txt"]),
|
||||
("typoscript", &["*.typoscript", "*.ts"]),
|
||||
("typoscript", &["*.typoscript"]),
|
||||
("vala", &["*.vala"]),
|
||||
("vb", &["*.vb"]),
|
||||
("vcl", &["*.vcl"]),
|
||||
|
@ -292,3 +292,20 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
|
|||
]),
|
||||
("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:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue