Skip to content

Commit

Permalink
refactor(config): Allow extending type matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Page committed Apr 7, 2021
1 parent 6729bf9 commit c71c9f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down

0 comments on commit c71c9f4

Please sign in to comment.