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

.luacheck std doesn't override cli --std #110

Closed
pablomayobre opened this issue May 4, 2017 · 2 comments
Closed

.luacheck std doesn't override cli --std #110

pablomayobre opened this issue May 4, 2017 · 2 comments

Comments

@pablomayobre
Copy link
Contributor

As reported in AtomLinter/linter-luacheck#32 the .luacheckrc file std config should override the --std argument passed in the CLI, or be added together, but currently the CLI takes presedence and the .luacheckrc std option is totally ignored.

I always thought that Luacheck had the following hierarchy:

  • CLI
  • .luacheckrc
  • Inline

So inline is more important than the .luacheclrc file, and the CLI. And the .luacheckrc files is more important than the CLI. This is not actually specified anywhere, but could be deduced from the structure of the docs... is this supposition wrong or is the issue described valid?

@mpeterv
Copy link
Owner

mpeterv commented May 4, 2017

Current behaviour is intended, somehow I missed documenting it, I'm sorry about that. The idea is that CLI options allow one to tweak configuration without having to go and edit .luacheckrc. It also allows tools to ensure value of some options regardless of what is specified in the config. E.g. a lot of editor plugins use --formatter <formatter> and then rely on the formatter passed through CLI being used.

It would be more convenient for your usecase if config overwrote CLI, but I think that once default config is implemented (#102) there will be no point in editor-specific configuration and this will not be an issue.

@pablomayobre
Copy link
Contributor Author

I understand and that seems fine, documenting this behaviour and implementing the global config should definitely fix the issue.

Other possible fix would be for tools to be able to specify a default config (separate from that of the CLI) and that could be overwritten by .luacheckrc

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