mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-23 16:12:25 -05:00
fix(config): Merge custom config over repo config
Custom config, like args, is more mutable, so it should be respected more.
This commit is contained in:
parent
5db9a8e1c9
commit
ecb32a674a
1 changed files with 3 additions and 3 deletions
|
@ -217,13 +217,13 @@ fn init_logging(level: Option<log::Level>) {
|
||||||
fn load_config(cwd: &std::path::Path, args: &args::Args) -> Result<config::Config, anyhow::Error> {
|
fn load_config(cwd: &std::path::Path, args: &args::Args) -> Result<config::Config, anyhow::Error> {
|
||||||
let mut config = config::Config::default();
|
let mut config = config::Config::default();
|
||||||
|
|
||||||
if let Some(path) = args.custom_config.as_ref() {
|
|
||||||
config.update(&config::Config::from_file(path)?);
|
|
||||||
}
|
|
||||||
if !args.isolated {
|
if !args.isolated {
|
||||||
let derived = config::Config::derive(cwd)?;
|
let derived = config::Config::derive(cwd)?;
|
||||||
config.update(&derived);
|
config.update(&derived);
|
||||||
}
|
}
|
||||||
|
if let Some(path) = args.custom_config.as_ref() {
|
||||||
|
config.update(&config::Config::from_file(path)?);
|
||||||
|
}
|
||||||
|
|
||||||
config.update(&args.config);
|
config.update(&args.config);
|
||||||
config.default.update(&args.overrides);
|
config.default.update(&args.overrides);
|
||||||
|
|
Loading…
Reference in a new issue