Closed thomasblanc closed 5 years ago
This solves #295 though to be fully XDG-compliant you should print a warning when using the legacy config file.
Where does that come from ?
This solves #295 though to be fully XDG-compliant you should print a warning when using the legacy config file.
Where does that come from ?
That comes from me being really bad at reading the XDG base directory specification and mixing up XDG_RUNTIME_DIR
with XDG_CONFIG_HOME
. Sorry about that.
This is not XDG compliant if
$XDG_CONFIG_HOME
is undefined or empty you need to fall back on$HOME/.config
for the configuration directory.
Done in last commit.
I don't think that works. You are not checking the file exists. in XDG_CONFIG_HOME. Really implement the algorithm as I suggested it will be very clear what is going on.
I think this is what you asked for. It doesn't change the behavior (well, it no longer checks that HOME
isn't ""
but that was the old behavior).
I think this is what you asked for.
I don't think so. I think in the previous iteration if you had XDG_CONFIG_HOME defined you'd never go in the legacy path. In any case even if it did actually work the logic was encoded in a very obscure manner. It now looks clearer. Thanks !
One last thing in the documentation only mention $XDG_CONFIG_HOME
not ~/.config/
or $HOME/.config
, it's implied by the XDG spec and makes the current documentation slightly wrong.
Really the XDG spec for XDG_CONFIG_HOME
is just: to find a configuration directory path use the value of $XDG_CONFIG_HOME
and if it's unset or empty use $HOME/.config
instead. In other words it doesn't define a file lookup procedure with fallbacks: it defines how to find a configuration directory path by simply consulting environment variables.
This PR broke the legacy path. It used to be $HOME/.ocp/ocp-indent.conf
but now it's $HOME/.ocp/.ocp-indent.conf
(extra leading dot in filename).
As stated in the title of this PR, that should do it.
This solves #295.