From c71c9f4f84fa990e4e45ab709e9b12db53d6e118 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 6 Apr 2021 21:09:02 -0500 Subject: [PATCH] refactor(config): Allow extending type matcher --- src/policy.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/policy.rs b/src/policy.rs index 7a80a04b0..b58948725 100644 --- a/src/policy.rs +++ b/src/policy.rs @@ -149,6 +149,8 @@ impl<'s> ConfigEngine<'s> { 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(); for (type_name, type_engine) in type_.into_iter() { let mut new_type_engine = default.clone(); @@ -164,7 +166,7 @@ impl<'s> ConfigEngine<'s> { walk, default, types, - type_matcher: ignore::types::TypesBuilder::new().add_defaults().build()?, + type_matcher: type_matcher.build()?, }; self.configs.insert(cwd.to_owned(), dir);