Skip to content

Commit

Permalink
Fix cache invalidation for nested pyproject.toml files (#12727)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Aug 7, 2024
1 parent f34b9a7 commit a631d60
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/ruff_workspace/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,16 @@ impl<'a> Resolver<'a> {
.insert(format!("{path}/{{*filepath}}"), self.settings.len() - 1)
{
Ok(()) => {}
Err(InsertError::Conflict { .. }) => {}
Err(InsertError::Conflict { .. }) => {
return;
}
Err(_) => unreachable!("file paths are escaped before being inserted in the router"),
}

// Insert a mapping that matches the directory itself (without a trailing slash).
// Inserting should always succeed because conflicts are resolved above and the above insertion guarantees
// that the path is correctly escaped.
self.router.insert(path, self.settings.len() - 1).unwrap();
}

/// Return the appropriate [`Settings`] for a given [`Path`].
Expand Down

0 comments on commit a631d60

Please sign in to comment.