Skip to content

Conversation

@Gaweringo
Copy link
Contributor

On Windows, XDG_CONFIG_HOME and HOME are not defined by default, which meant that the concatenation turned into nil .. './config' resulting in an error.

This now checks, if a home directory can be found and only then adds it to the paths list. Which means, that with this change, there is no option to have a global config file on Windows (Except for the user defining a HOME or XDG_CONFIG_HOME environment variable themselves).
This could be changed by adding a check to get an env-variable like USERPROFILE or LOCALAPPDATA.

Since vsg does not specify a directory for its config files and the check for one in the home directory is something conform.nvim does on its own, maybe it would be better to decide on a directory on Windows as well and add that. Let me know what you think.

@github-actions github-actions bot requested a review from stevearc December 30, 2025 19:22
Copy link
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly leave the choices of the individual formatter configurations up to the people that actually use them. If you'd like to add a new "global config" directory in a location that makes more sense for Windows, I'm happy to merge it.

On Windows, `XDG_CONFIG_HOME` and `HOME` are not defined by default,
which meant that the concatenation turned into `nil .. './config'`
resulting in an error.

Now `vim.uv.os_homedir()` is used, which should always return a string.
@stevearc
Copy link
Owner

Thanks for the PR!

@stevearc stevearc merged commit 4b713b9 into stevearc:master Dec 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants