8000 Config not searched in `$XDG_CONFIG_HOME` on macOS · Issue #88 · lunarmodules/luacheck · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Config not searched in $XDG_CONFIG_HOME on macOS #88
Open
@erikw

Description

@erikw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0