-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that fn config_path
returns canonicalized paths.
#6272
Conversation
Thanks for the PR. Would you mind double checking if there's any difference in the output when running Output should look something like this:
|
There are no output changes in this scenario. Before the changes:
After the changes:
As expected the path passed to Before the changes:
After the changes:
|
Thanks for double checking. I figured that the behavior would change slightly and wanted to confirm that. Edit: Diff Check Job passed ✅ |
This commit ensures that `fn config_path` in `rustfmt/src/config/mod.rs` always returns canonicalized paths. This is achieved by canonicalizing both: 1) paths received via `CliOptions` (after checking if the path exists) as well as 2) paths returned via `get_toml_path` (canonicalizing within `fn get_toml_path`). Fixes rust-lang#6178
This commit ensures that
fn config_path
inrustfmt/src/config/mod.rs
always returns canonicalized paths. This is achieved by canonicalizing both: 1) paths received viaCliOptions
(after checking if the path exists) as well as 2) paths returned viaget_toml_path
(canonicalizing withinfn get_toml_path
).Fixes #6178