mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 10:31:02 -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) =
|
||||
find_project_file(cwd, &["typos.toml", "_typos.toml", ".typos.toml"])
|
||||
{
|
||||
log::debug!("Loading {}", path.display());
|
||||
Some(Self::from_file(&path)?)
|
||||
} else {
|
||||
None
|
||||
|
|
|
@ -123,8 +123,11 @@ impl<'s> ConfigEngine<'s> {
|
|||
let mut config = crate::config::Config::default();
|
||||
|
||||
if !self.isolated {
|
||||
if let Some(derived) = crate::config::Config::from_dir(cwd)? {
|
||||
for ancestor in cwd.ancestors() {
|
||||
if let Some(derived) = crate::config::Config::from_dir(ancestor)? {
|
||||
config.update(&derived);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(overrides) = self.overrides.as_ref() {
|
||||
|
|
Loading…
Reference in a new issue