Lint-ing tool for Lua [closed]

我是研究僧i 提交于 2019-12-09 05:20:37

问题


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?


回答1:


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




回答2:


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!