mirror of
https://github.com/crate-ci/typos.git
synced 2025-01-25 07:58:58 -05:00
refactor(config): Allow extending type matcher
This commit is contained in:
parent
6729bf9f7c
commit
c71c9f4f84
1 changed files with 3 additions and 1 deletions
|
@ -149,6 +149,8 @@ impl<'s> ConfigEngine<'s> {
|
||||||
|
|
||||||
let walk = self.walk.intern(files);
|
let walk = self.walk.intern(files);
|
||||||
|
|
||||||
|
let mut type_matcher = ignore::types::TypesBuilder::new();
|
||||||
|
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() {
|
||||||
let mut new_type_engine = default.clone();
|
let mut new_type_engine = default.clone();
|
||||||
|
@ -164,7 +166,7 @@ impl<'s> ConfigEngine<'s> {
|
||||||
walk,
|
walk,
|
||||||
default,
|
default,
|
||||||
types,
|
types,
|
||||||
type_matcher: ignore::types::TypesBuilder::new().add_defaults().build()?,
|
type_matcher: type_matcher.build()?,
|
||||||
};
|
};
|
||||||
|
|
||||||
self.configs.insert(cwd.to_owned(), dir);
|
self.configs.insert(cwd.to_owned(), dir);
|
||||||
|
|
Loading…
Add table
Reference in a new issue