Skip to content
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

imports_granularity not working on global config file #5471

Open
laralove143 opened this issue Jul 27, 2022 · 8 comments · May be fixed by #5515
Open

imports_granularity not working on global config file #5471

laralove143 opened this issue Jul 27, 2022 · 8 comments · May be fixed by #5515

Comments

@laralove143
Copy link

this is very weird, if my config file is at /Users/lara/Library/Preferences/rustfmt/rustfmt.toml the options are detected (cargo fmt complains it can't set the options on stable), but they don't do anything.. i'm not sure if only imports_granularity is affected

putting the file at /Users/lara/rustfmt.toml or next to Cargo.toml makes it work fine

rustfmt version is rustfmt 1.5.1-nightly (4d6d601c 2022-07-26)

@ytmimi
Copy link
Contributor

ytmimi commented Jul 27, 2022

I believe this might be a duplicate of #4613

@ytmimi
Copy link
Contributor

ytmimi commented Jul 27, 2022

I think the issue is that the Configurations.md is pointing to dirs v1.0.4, but we've since upgraded to dirs v4.0.0. Can you try placing the global config in $HOME/Library/Application Support like the v4.0.0 docs suggest and see if that resolves the issue.

@ytmimi ytmimi added good first issue Issues up for grabs, also good candidates for new rustfmt contributors p-medium and removed p-low labels Jul 27, 2022
@ytmimi
Copy link
Contributor

ytmimi commented Jul 27, 2022

For anyone wanting to work on this we just need to update the link in the first paragraph of the Configurations.md to point at the same version as listed in the Cargo.toml

@ytmimi
Copy link
Contributor

ytmimi commented Jul 27, 2022

For what it's worth this was the PR that bumped the version #5237

@aizpurua23a
Copy link
Contributor

Hey! Consider this PR :)

@ytmimi
Copy link
Contributor

ytmimi commented Jul 27, 2022

@aizpurua23a thanks for the PR! @laralove143 when you have a moment please confirm that placing your config in $HOME/Library/Application Support resolves the issue.

@laralove143
Copy link
Author

laralove143 commented Jul 29, 2022

it doesn't seem to detect the config, its at /Users/lara/Library/Application Support/rustfmt/rustfmt.toml there are nightly options but cargo fmt doesn't complain about anything

@calebcartwright calebcartwright removed good first issue Issues up for grabs, also good candidates for new rustfmt contributors documentation labels Jul 30, 2022
@calebcartwright
Copy link
Member

Can you try running with the --verbose flags? That should tell you which config file, if any, is getting picked up. Remember that rustfmt doesn't (currently) support aggregated configs, so it will just pick up the first one it finds on the probe path. That means that if you have one locally in your project, a parent directory, etc. those will get selected and rustfmt won't look in home directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants