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 settings should default to unset. #30

Closed
Nexela opened this issue Sep 3, 2018 · 3 comments
Closed

luacheck settings should default to unset. #30

Nexela opened this issue Sep 3, 2018 · 3 comments
Labels
enhancement indev in development

Comments

@Nexela
Copy link

Nexela commented Sep 3, 2018

The default CLI arguments should contain no extra paramaters and instead be wrapped in settings checks.
This will allow for 'out of the box' working with .luacheckrc (this file by default is looked for in the cwd up to drive root, in the users home directory, and finally in the luacheck appdata directory on windows)

const defaultOpt = ['--no-color', '--codes', '--ranges', '--formatter', 'plain'];

'-m' and '-t'' should be removed or have their own settings.entry

        if (docSym) {
            globals = docSym.dependences().map((dep) => {
                return dep.name;
            });
        }

        if (globals.length > 0) {
            args.push('--read-globals');
            args.push.apply(args, globals);
}

Should also be wrapped in a settings check.

Also a minor thing but finally
if a .luacheckrc has an error in it, outputting the error could be helpful. Example output string follows
Critical error: Couldn't load configuration from ..\.luacheckrc: syntax error (line 163: '}' expected (to close '{' at line 156) near 'util')

@liwangqian liwangqian added enhancement indev in development labels Sep 8, 2018
@liwangqian
Copy link
Owner

I use the -m -t argument because my work is still using the lua 5.1 module style, this can be solved by detecting the style of the lua module.

@Nexela
Copy link
Author

Nexela commented Sep 9, 2018

One option is to have a settings.cliArguments string type that will get pre-pending when building the args list
settings.cliArguments ["-m", "-t"]

@liwangqian
Copy link
Owner

@Nexela Try the newlest version and make some feedback, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement indev in development
Projects
None yet
Development

No branches or pull requests

2 participants