mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-23 16:12:25 -05:00
parent
10d97949e8
commit
57ace37ec4
1 changed files with 12 additions and 2 deletions
|
@ -153,9 +153,19 @@ impl<'s> ConfigEngine<'s> {
|
||||||
type_matcher.add_defaults();
|
type_matcher.add_defaults();
|
||||||
let mut types: std::collections::HashMap<_, _> = Default::default();
|
let mut types: std::collections::HashMap<_, _> = Default::default();
|
||||||
for (type_name, type_engine) in type_.into_iter() {
|
for (type_name, type_engine) in type_.into_iter() {
|
||||||
|
if type_engine.extend_glob.is_empty() {
|
||||||
|
if type_matcher
|
||||||
|
.definitions()
|
||||||
|
.iter()
|
||||||
|
.all(|def| def.name() != type_name.as_str())
|
||||||
|
{
|
||||||
|
anyhow::bail!("Unknown type definition `{}`, pass `--type-list` to see valid names or set `extend_globs` to add a new one.", type_name);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
for glob in type_engine.extend_glob.iter() {
|
for glob in type_engine.extend_glob.iter() {
|
||||||
type_matcher.add(type_name.as_str(), glob.as_str())?;
|
type_matcher.add(type_name.as_str(), glob.as_str())?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut new_type_engine = default.clone();
|
let mut new_type_engine = default.clone();
|
||||||
new_type_engine.update(&type_engine.engine);
|
new_type_engine.update(&type_engine.engine);
|
||||||
|
|
Loading…
Reference in a new issue