Closed Jayman2000 closed 10 months ago
Hello Jason,
Thanks for reporting this, I can confirm the problem when XDG_CONFIG_HOME
is set in environment.
Here’s what I think that the problem is: The test sets the
HOME
variable in an attempt to get yamllint to load an alternative global configuration file, but yamllint doesn’t look in the user’s home directory for a global configuration ifXDG_CONFIG_HOME
is set.
I think you are right: https://github.com/adrienverge/yamllint/blob/3288d05/yamllint/cli.py#L184-L188.
Do you think deleting / restoring XDG_CONFIG_HOME
in this problematic test would be a good solution? If yes, would you like to implement it?
Do you think deleting / restoring
XDG_CONFIG_HOME
in this problematic test would be a good solution?
Yeah.
If yes, would you like to implement it?
Sure!
I’m running NixOS, and on my system, the
XDG_CONFIG_HOME
environment variable is set by default. This causes one of the unit tests to fail. You should be able to reproduce this issue on any system by running:I can workaround the problem by doing this:
Here’s what I think that the problem is: The test sets the
HOME
variable in an attempt to get yamllint to load an alternative global configuration file, but yamllint doesn’t look in the user’s home directory for a global configuration ifXDG_CONFIG_HOME
is set.