mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-22 09:01:04 -05:00
fix(config): Improve output from --dump-config
This commit is contained in:
parent
8d02a86f2f
commit
b8294d7afa
1 changed files with 21 additions and 4 deletions
|
@ -131,6 +131,26 @@ impl<'s> ConfigEngine<'s> {
|
||||||
config.update(overrides);
|
config.update(overrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut types = Default::default();
|
||||||
|
std::mem::swap(&mut types, &mut config.type_);
|
||||||
|
|
||||||
|
let mut types = types
|
||||||
|
.into_iter()
|
||||||
|
.map(|(type_, type_engine)| {
|
||||||
|
let mut new_engine = config.default.clone();
|
||||||
|
new_engine.update(&type_engine.engine);
|
||||||
|
new_engine.update(&config.overrides);
|
||||||
|
let new_type_engine = crate::config::TypeEngineConfig {
|
||||||
|
extend_glob: type_engine.extend_glob,
|
||||||
|
engine: new_engine,
|
||||||
|
};
|
||||||
|
(type_, new_type_engine)
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
std::mem::swap(&mut types, &mut config.type_);
|
||||||
|
|
||||||
|
config.default.update(&config.overrides);
|
||||||
|
|
||||||
Ok(config)
|
Ok(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,10 +187,7 @@ impl<'s> ConfigEngine<'s> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut new_type_engine = default.clone();
|
let type_config = self.init_file_config(type_engine.engine);
|
||||||
new_type_engine.update(&type_engine.engine);
|
|
||||||
new_type_engine.update(&overrides);
|
|
||||||
let type_config = self.init_file_config(new_type_engine);
|
|
||||||
types.insert(type_name, type_config);
|
types.insert(type_name, type_config);
|
||||||
}
|
}
|
||||||
default.update(&overrides);
|
default.update(&overrides);
|
||||||
|
|
Loading…
Reference in a new issue