Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lint-ing tool for Lua [closed]

Tags:

grammar

lua

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?

like image 647
Tgwizman Avatar asked Aug 02 '12 04:08

Tgwizman


2 Answers

Lua-Checker will get the job done for you. Another tool is Lua Lint

like image 54
ThirdOne Avatar answered Sep 22 '22 16:09

ThirdOne


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'
like image 24
Paul Kulchenko Avatar answered Sep 24 '22 16:09

Paul Kulchenko