cuberite / CuberitePluginChecker

Automated script for CI-checking Cuberite plugins
The Unlicense
3 stars 3 forks source link

Added luacheck config file, install luacheck and run it #33

Closed Seadragon91 closed 7 years ago

Seadragon91 commented 7 years ago

This adds luacheck to test the source files from CuberitePluginChecker. Closes #26

@madmaxoft You said that commands in test/overrides can run parallel. Do I only need to change the line?

lua CuberitePluginChecker.lua -p ~/Gallery -a ~/AutoAPI -e ~/ManualAPI.lua -i APIImpl/All.lua -s tests/Gallery/FuzzCommands.lua

to

lua CuberitePluginChecker.lua -p ~/Gallery -a ~/AutoAPI -e ~/ManualAPI.lua -i APIImpl/All.lua -s tests/Gallery/FuzzCommands.lua && luacheck -q .
Seadragon91 commented 7 years ago

Have done a few corrections in own commits.

madmaxoft commented 7 years ago

You don't need to change the current check line for CircleCI, adding a new one is the right solution (the Gallery plugin check and LuaCheck can run in parallel).

I don't think the .luacheckrc file needs to list Cuberite's globals, does it?

madmaxoft commented 7 years ago

For now, make LuaCheck ignore all the warnings / errors, we'll re-enable them after we fix them (but fixing should not be part of this PR)

Seadragon91 commented 7 years ago

I emptied now the table globals and added cFile and cPluginManager they are used.

Seadragon91 commented 7 years ago

Okay will do that.

Seadragon91 commented 7 years ago

Done. Added the current directory to table exclude_files to let the CI succeeds. I also removed the whole table globals from file .luacheckrc.

madmaxoft commented 7 years ago

Well, that's not a solution that will work too well. Imagine what the next steps should be - enable a single warning in LuaCheck and fix all the code that generates such a warning. With LuaCheck ignoring effectively everything, this will not be easy.

You should instead ignore all the warnings specifically, so that later we can remove each warning that has been fixed. Just like in Cuberite - we had lots of ignored warnings and got rid of most of the exceptions eventually.

Seadragon91 commented 7 years ago

Yes, you are right. Changed it.

madmaxoft commented 7 years ago

Great, thanks.