I have recently started doing a little Lua for Minecraft's mod, Computer Craft. I've always been hooked on javascript, and the tool I found the most useful was JS Lint. My question is, is there something like JS Lint that I can use to check my Lua scripts?
Lua-Checker will get the job done for you. Another tool is Lua Lint
There is also lua-inspect. I integrated it into ZeroBrane Studio IDE and extended the list of potential problems it reports. Here is the subset of what gets reported from one of my tests:
- inspect.lua(1): first assignment to global variable 'f'
- inspect.lua(2): first use of unknown global variable 'b'
- inspect.lua(4): unused parameter 'to' in anonymous function
- inspect.lua(8): unused local variable 'y'; consider removing or replacing with '_'
- inspect.lua(11): local variable 'y' masks earlier declaration on line 10
- inspect.lua(15): local function 'y' masks earlier declaration on line 8
- inspect.lua(17): unused local function 'test'
- inspect.lua(17): unused parameter 'x' in function 'test'
- inspect.lua(30): unused parameter 'bar' in function 'tbl.foo'
来源:https://stackoverflow.com/questions/11770951/lint-ing-tool-for-lua