-
Notifications
You must be signed in to change notification settings - Fork 4
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
Custom configuration file path #49
Comments
I tend to think of this as a per-project tool, but I'm okay with a PR to look in those well-known locations. It looks like https://lib.rs/crates/directories is the right crate to use for this. |
Everytime I tried to do some coding in Rust, I had hard times. |
Looking at the code, it occurs to me that to really make this work might also require adding a new Another option would be to look for a VCS directory like |
Apparently I don't know how my own code works. It already does this. So I think looking for the config file outside the current dir and its parents should just work as long as |
Hi !
First, thanks a lot for this amazing project !!!
I just started to use it today and it does everything I need.
The tool is very easy to configure and easy to use.
However, I miss one thing : using a custom location for the configuration file.
I might have missed something but specifying a custom location with
--config=<custom_path>/precious.toml
,only allows using 'precious' on files that have
<custom_path>
as directory ancestor.Example :
Let say the current directory is
$HOME/code/python/foobar
This command fails
but this one works
precious --config="$HOME/precious.toml" tidy --label=python file.py
For modern tools, I'm really not a fan of having config files at the root of my 'home' directory.
I'm also not a fan of having to use a config file in every project directories because I would have to duplicate the config file a lot.
If I modify one 'precious' config file in a project, I would have to update all other config files.
Using one central config file would also allows me to configure my IDE or text editor to use 'precious' for every file independently of their locations.
Is there is a way to not force "same ancestor" location, please ?
Maybe by supporting environment variables or "well-known" locations like the following ?
$XDG_CONFIG_DIR/precious/precious.toml
$XDG_CONFIG_DIR/precious.toml
%APPDATA\precious\precious.toml
Thanks a lot again for this project !
The text was updated successfully, but these errors were encountered: