mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-26 02:51:08 -05:00
commit
4ea85c1b69
3 changed files with 14 additions and 3 deletions
|
@ -47,7 +47,7 @@ impl Entry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn imply(variants: &mut Vec<Variant>, required: Category, missing: Category) {
|
fn imply(variants: &mut [Variant], required: Category, missing: Category) {
|
||||||
let missing_exists = variants
|
let missing_exists = variants
|
||||||
.iter()
|
.iter()
|
||||||
.any(|v| v.types.iter().any(|t| t.category == missing));
|
.any(|v| v.types.iter().any(|t| t.category == missing));
|
||||||
|
|
|
@ -171,6 +171,7 @@ impl typos::Dictionary for BuiltIn {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::ptr_arg)]
|
||||||
fn case_correct(correction: &mut Cow<'_, str>, case: Case) {
|
fn case_correct(correction: &mut Cow<'_, str>, case: Case) {
|
||||||
match case {
|
match case {
|
||||||
Case::Lower | Case::None => (),
|
Case::Lower | Case::None => (),
|
||||||
|
|
|
@ -313,8 +313,18 @@ impl DirConfig {
|
||||||
.and_then(|g| g.file_type_def())
|
.and_then(|g| g.file_type_def())
|
||||||
.map(|f| f.name());
|
.map(|f| f.name());
|
||||||
|
|
||||||
name.and_then(|name| self.types.get(name).copied())
|
name.and_then(|name| {
|
||||||
.unwrap_or(self.default)
|
log::debug!("{}: `{}` policy", path.display(), name);
|
||||||
|
self.types.get(name).copied()
|
||||||
|
})
|
||||||
|
.unwrap_or_else(|| {
|
||||||
|
log::debug!(
|
||||||
|
"{}: default policy for `{}` file type",
|
||||||
|
path.display(),
|
||||||
|
name.unwrap_or("<unknown>")
|
||||||
|
);
|
||||||
|
self.default
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue