Skip to content

Commit

Permalink
Resolve cache-dir relative to project root (#7962)
Browse files Browse the repository at this point in the history
## Summary

Unlike other filepath-based settings, the `cache-dir` wasn't being
resolved relative to the project root, when specified as an absolute
path.

Closes #7958.
  • Loading branch information
charliermarsh authored Oct 14, 2023
1 parent e261eb7 commit 8061894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/ruff_workspace/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl Configuration {
.cache_dir
.map(|dir| {
let dir = shellexpand::full(&dir);
dir.map(|dir| PathBuf::from(dir.as_ref()))
dir.map(|dir| fs::normalize_path_to(dir.as_ref(), project_root))
})
.transpose()
.map_err(|e| anyhow!("Invalid `cache-dir` value: {e}"))?,
Expand Down

0 comments on commit 8061894

Please sign in to comment.