Skip to content
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

Config not searched in $XDG_CONFIG_HOME on macOS #231

Closed
erikw opened this issue Mar 14, 2023 · 2 comments
Closed

Config not searched in $XDG_CONFIG_HOME on macOS #231

erikw opened this issue Mar 14, 2023 · 2 comments

Comments

@erikw
Copy link

erikw commented Mar 14, 2023

First, thanks for this great tool. I recently started using it together with NeoVim and it works splendid!

As documented, the config file is on macOS looked for in $HOME/Library/Application\ Support/Luacheck and not in the XDG path $XDG_CONFIG_HOME/luacheck.

macOS is also a modern Unix-like/based system and it would make sense to look for the config file in the XDG Path if not found in the Library path. I manage my config files in a dotfiles repo and have everything in ~/.config that supports this. I think many developers in macOS also utilize the XDG paths.

In my case this meant that in the NeoVim plugin ALE I had to configure luacheck with extra options:

 vim.g.ale_lua_luacheck_options = "--config $XDG_CONFIG_HOME/luacheck/.luacheckr"

This should not be needed.

The code that would need update is here:

if system == "Darwin" then
local home_dir = os.getenv("HOME")
if home_dir then
return fs.join(home_dir, "Library", "Application Support", "Luacheck")
end
else

If not finding a config in the Library path, the same logic that is currently in the else clause should be done in the Darwin case

@alerque
Copy link

alerque commented Mar 14, 2023

This is not the right repository to report this — the canonical repository for LuaCheck is now under lunarmodules. See #198 for background. I would request you close this issue (since nobody else has access to do so) and open a new one on the canonical repository (assuming this is an issue in the current version, v1.1.0). Contributions are welcome, this sounds like a reasonable suggestion.

@erikw
Copy link
Author

erikw commented Mar 14, 2023

Oh dear 😢 @alerque

Thank you for the sharing (the very sad news). I re-posted it here:

lunarmodules#88

@erikw erikw closed this as completed Mar 14, 2023
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

No branches or pull requests

2 participants