Tools used for development
#21
I've removed Visual Studio 2008 and added ZeroBrane studio.
Reply
Thanks given by:
#22
Found a nice tool for checking lua code and added it as a external tool in Decoda  Smile  

Name: luacheck
link: https://github.com/mpeterv/luacheck

As external tool in Decoda:
Title: Luacheck
Command: luacheck
Arguments: $(ItemDir) -g -a

-g ignore global variables, for example cPluginManger
-a ignore unused function arguments

With this 2 flags it creates a useful output.


Edit: Here a small output from Core
Warnings:
Core\banlist.lua:251:9: unused variable 'Reason'
Core\banlist.lua:253:9: unused variable 'Reason'

Code:
-- If the player supplied a reason, use that, else use a default reason.
if (a_Split[3] ~= nil) then
    local Reason = table.concat(a_Split, " ", 3)
else
    local Reason = "No reason."
end

-- Add the player to the banlist:
AddPlayerToBanlist(a_Split[2], Reason, a_Player:GetName());

As you see the variable Reason is defined inside of a if block and Reason is nil hereBig Grin
Reply
Thanks given by:
#23
Looks nice, should be pretty easy to add to ZeroBraneStudio as well.

It might be a great addition to plugin CI tests, together with my PluginChecker, if it ever sees the light of the day Smile

Are you seriously still using Decoda? It is really outdated and there are other IDEs much better equipped for Cuberite plugin development.
Reply
Thanks given by:
#24
I looked into ZeroBraneStudio, it has a static analyzer but it looks like it only works for the current open file. Yes it could be nice for CI tests.
It's also possible to install it as a module and then use it in lua.
Reply
Thanks given by:
#25
If you installed the Cuberite module into ZBS, as is described in the API docs article ( http://apidocs.cuberite.org/SettingUpZeroBrane.html ), then ZBS actually can analyze the plugins in the very same way as Cuberite does - it has an implementation of joining the files together and using the correct load order (alpha-sorted, with Info.lua last) etc. It can also call the utility scripts - InfoDump.lua (converts Info.lua into README.md and forum thread post text)
Reply
Thanks given by:




Users browsing this thread: 7 Guest(s)