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

Global configuration file #102

Closed
mpeterv opened this issue Mar 14, 2017 · 12 comments
Closed

Global configuration file #102

mpeterv opened this issue Mar 14, 2017 · 12 comments

Comments

@mpeterv
Copy link
Owner

mpeterv commented Mar 14, 2017

There should be a way to put some configuration into a file in predetermined location and have it apply when project-specific config isn't found.

Some points:

  • Why not use global config even when local config is found, as a foundation? The problem is that then presence of local config doesn't ensure consistent behaviour for several users as well as it does now (currently it's enough to set 'std' option or use same Lua version).
  • What should be the name of the file? '.luacheckrc' most likely, like local config.
  • Where should the file be located? It has to depend on OS, need to check what's typically used on Windows.
  • Should there be options to disable or alter path of global config? An option to disable it should be enough.
@pablomayobre
Copy link
Contributor

pablomayobre commented Apr 29, 2017

I would like to standarize the configuration file used in .luacheckrc and possibly merge it with atom-autocomplete-lua .luacompleterc

@mpeterv do you have any interest on this? What about you @dapetcu21?

This file would (for example) be called .luarc and its format would be JSON or similar (both understood by Lua and JS), and would be an alternative to both .luacheckrc and .luacompleterc. Note that the intention is not to replace the current formats but to provide one which can be understood by both Luacheck and Autocomplete

@mpeterv
Copy link
Owner Author

mpeterv commented Apr 29, 2017

@positive07 that could be interesting, but please open a separate issue for it.

@pablomayobre
Copy link
Contributor

pablomayobre commented Apr 29, 2017

If you are fine with discussing in this repo I'll do it, otherwise I think we can discuss it privately (I still need to see if @dapetcu21 is interested too)

Feel free to delete both this comments

@dapetcu21
Copy link

@positive07 Could be interesting, but it's a pretty big undertaking, both in terms of coordination effort and actual development.

@pablomayobre
Copy link
Contributor

pablomayobre commented Apr 30, 2017

All right lets discuss this over at pablomayobre/.luarc#1

Feel free to clear this conversation from here

mpeterv added a commit that referenced this issue May 6, 2017
New --[no-]default-config CLI option. If project-specific
.luacheckrc is not found, global config is loaded from a default
location or path provided with --default-config.

Ref #102.
@mpeterv
Copy link
Owner Author

mpeterv commented May 6, 2017

Implemented on master branch, global config location is %USERPROFILE%\Local Settings\Application Data\Luacheck\Config\.luacheckrc on Windows and $XDG_CONFIG_HOME/luacheck/.luacheckrc or ~/.config/luacheck/.luacheckrc on other systems (by default). Need to check if there are better options for Windows and Mac.

@pablomayobre
Copy link
Contributor

A few options, the install folder, next to luajit... Also why Luacheck\Config in Windows and not simply Luacheck?

@mpeterv
Copy link
Owner Author

mpeterv commented May 6, 2017

Yes, just Luacheck for Windows is good enough. I don't want to use intallation directory of Lua/LuaRocks or Luacheck itself, it should be a single location. Otherwise user would have to copy files around if using several installations (e,g. with hererocks).

@pablomayobre
Copy link
Contributor

pablomayobre commented May 7, 2017

Understood, sounds great then!

Is a new release comming?

@mpeterv
Copy link
Owner Author

mpeterv commented May 7, 2017

Yes, I plan to make a new release tomorrow

@mpeterv
Copy link
Owner Author

mpeterv commented May 8, 2017

I'm uncertain if on Mac config should be under ~/.config like on Linux or under ~/Library/Application Support as recommended by Mac app programming guide.

@mpeterv
Copy link
Owner Author

mpeterv commented May 8, 2017

After reading microsoft/vscode#3884 looks like ~/Library/Application Support is preferred.

@mpeterv mpeterv closed this as completed May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants