-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
[openwisp-config] Add luacheck to runtests script and fix all warnings #77
Comments
@okraits I merged the two tasks into one becuase it would be time-consuming to enforce having two tasks in which one is dependent on the other (we may get two students claiming both tasks concurrently) so in this case it made sense to merge the two in one |
👍 |
1 similar comment
👍 |
openwisp#77 - added travis.yml with dependencies installation script. - added luacheck test command in runtests script. - fixed accessing undefined variable `uci` warning Fixes openwisp#77
@nemesisdesign I had a look at this and noticed some things:
I'm not sure if this is wanted. But maybe I'm wrong. |
@okraits no I think it was just not under my radar, I'm totally in favour of making the check stricter and keep the code cleaner |
So let's reopen this issue so that things can get improved. |
@okraits is this still relevant? |
@nemesisdesign Yes, of course. |
Was planning on working on this, just had a few queries:
Is this something that needs to be fixed (I couldn't tell if this was wanted or not) |
This is not wanted and needs to be fixed.
I would remove all three flags if possible. |
For convenience, you can keep the |
@okraits
Idea: The file could be set out as such: ignore = {"213/_.*"} -- unused Loop Variables beginning with underscore will be ignored, keeping readability
files["openwisp-config/tests"] = {
ignore = {"11./Test.*"} -- globals relating to defining unittests are ignored
} This will ensure a strict code linting, whilst also working around the issues we currently have. |
This means that those reported luacheck errors are in the external modules we use, not in our code, right? That would mean that those errors have to be fixed upstream. This has to be done, but it is out of scope of this PR:
A very good idea! Go ahead! 😀 |
Reserved for GCI
Luacheck is a static analyzer and a linter for Lua.
It is possible to integrate luacheck in many popular editors, like atom, vim, VS Code.
Prepend the luacheck test in the openwisp-config
runtests
script (add right aftercd openwisp-config/tests/
) and fix all warnings and errors luacheck reports.The text was updated successfully, but these errors were encountered: