rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

support XDG_CONFIG_HOME for configuration file on macOS

Open heygarrett opened this issue 1 year ago • 4 comments

Fixes #4613

Replacing dirs with etcetera adds support for checking XDG_CONFIG_HOME on macOS when looking for a configuration file.

I'm new to Rust, so let me know if I'm missing anything!

heygarrett avatar Jun 02 '24 19:06 heygarrett

I took a quick look at the dirs README and the dirs code, and both seem to suggest that XDG_CONFIG_HOME is already supported by dirs.

ytmimi avatar Jun 25 '24 16:06 ytmimi

Oh wait, that's just for linux. Reopening.

ytmimi avatar Jun 25 '24 16:06 ytmimi

@heygarrett we've had issues in the past where users have reported configs not being loaded properly. To avoid any breakage due to the proposed switch to etcetera I think we'll need to include some tests to validate that the existing config loading behavior won't change, and that we're only adding support for new config directories.

In the past I tried adding tests for the config loading rules, though I'm not entirely sure if that old PR is the best approach for this. Maybe you can use it as inspiration though.

ytmimi avatar Jun 25 '24 16:06 ytmimi

Thanks, @ytmimi! I'll take a look.

heygarrett avatar Jun 25 '24 17:06 heygarrett