Skip to content

Commit

Permalink
Simplify global config location on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterv committed May 7, 2017
1 parent f2de84e commit 2fdaceb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* If project-specific `.luacheckrc` is not found, `luacheck` will now use
config from some global location if it is present there. Default global
location is
`%USERPROFILE%\Local Settings\Application Data\Luacheck\Config\.luacheckrc`
`%USERPROFILE%\Local Settings\Application Data\Luacheck\.luacheckrc`
on Windows and `$XDG_CONFIG_HOME/luacheck/.luacheckrc` or
`~/.config/luacheck/.luacheckrc` on other systems.
This behaviour can be tweaked with `--default-config` and
Expand Down
2 changes: 1 addition & 1 deletion docsrc/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Option Meaning
``--no-config`` Do not look up custom configuration file.
``--default-config <config>`` Default path to custom configuration file, to be used if ``--[no-]config`` is not used and ``.luacheckrc`` is not found.

Default value for this option is ``%USERPROFILE%\Local Settings\Application Data\Luacheck\Config\.luacheckrc`` on Windows
Default value for this option is ``%USERPROFILE%\Local Settings\Application Data\Luacheck\.luacheckrc`` on Windows
and ``$XDG_CONFIG_HOME/luacheck/.luacheckrc`` or ``~/.config/luacheck/.luacheckrc`` on other systems.
``--no-default-config`` Do not use fallback configuration file.
``--filename <filename>`` Use another filename in output, for selecting
Expand Down
2 changes: 1 addition & 1 deletion docsrc/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Configuration file
``luacheck`` tries to load configuration from ``.luacheckrc`` file in the current directory. If not found, it will look for it in the parent directory and so on, going up until it reaches file system root. Path to config can be set using ``--config`` option, in which case it will be used during recursive loading. Config loading can be disabled using ``--no-config`` flag.

If neither of ``--config``, ``--no-config``, and ``--no-default-config`` options are used, ``luacheck`` will attempt to load configuration from value of ``--default-config`` option,
or ``%USERPROFILE%\Local Settings\Application Data\Luacheck\Config\.luacheckrc`` on Windows and ``$XDG_CONFIG_HOME/luacheck/.luacheckrc`` or ``~/.config/luacheck/.luacheckrc``
or ``%USERPROFILE%\Local Settings\Application Data\Luacheck\.luacheckrc`` on Windows and ``$XDG_CONFIG_HOME/luacheck/.luacheckrc`` or ``~/.config/luacheck/.luacheckrc``
on other systems by default.

Config is simply a Lua script executed by ``luacheck``. It may set various options by assigning to globals or by returning a table with option names as keys.
Expand Down
2 changes: 1 addition & 1 deletion src/luacheck/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ if utils.is_windows then
end

if local_app_data_dir then
global_config_dir = fs.join(local_app_data_dir, "Luacheck", "Config")
global_config_dir = fs.join(local_app_data_dir, "Luacheck")
end
else
local config_home_dir = os.getenv("XDG_CONFIG_HOME")
Expand Down

0 comments on commit 2fdaceb

Please sign in to comment.