mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-01 05:20:59 -05:00
Merge pull request #247 from epage/search
fix(cli): Discover config in parent dirs
This commit is contained in:
commit
7c6b85c442
2 changed files with 6 additions and 2 deletions
|
@ -17,6 +17,7 @@ impl Config {
|
||||||
let config = if let Some(path) =
|
let config = if let Some(path) =
|
||||||
find_project_file(cwd, &["typos.toml", "_typos.toml", ".typos.toml"])
|
find_project_file(cwd, &["typos.toml", "_typos.toml", ".typos.toml"])
|
||||||
{
|
{
|
||||||
|
log::debug!("Loading {}", path.display());
|
||||||
Some(Self::from_file(&path)?)
|
Some(Self::from_file(&path)?)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
@ -123,8 +123,11 @@ impl<'s> ConfigEngine<'s> {
|
||||||
let mut config = crate::config::Config::default();
|
let mut config = crate::config::Config::default();
|
||||||
|
|
||||||
if !self.isolated {
|
if !self.isolated {
|
||||||
if let Some(derived) = crate::config::Config::from_dir(cwd)? {
|
for ancestor in cwd.ancestors() {
|
||||||
config.update(&derived);
|
if let Some(derived) = crate::config::Config::from_dir(ancestor)? {
|
||||||
|
config.update(&derived);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(overrides) = self.overrides.as_ref() {
|
if let Some(overrides) = self.overrides.as_ref() {
|
||||||
|
|
Loading…
Reference in a new issue