{"id":13896732,"url":"https://github.com/davidm/lua-inspect","last_synced_at":"2025-12-24T04:17:48.773Z","repository":{"id":987545,"uuid":"792563","full_name":"davidm/lua-inspect","owner":"davidm","description":"Lua code analysis, with plugins for HTML and SciTE","archived":false,"fork":false,"pushed_at":"2016-04-22T04:24:27.000Z","size":929,"stargazers_count":171,"open_issues_count":11,"forks_count":15,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-25T02:33:17.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://lua-users.org/wiki/LuaInspect","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidm.png","metadata":{"files":{"readme":"README.txt","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-07-23T03:40:03.000Z","updated_at":"2024-11-06T22:13:50.000Z","dependencies_parsed_at":"2022-08-16T11:45:13.501Z","dependency_job_id":null,"html_url":"https://github.com/davidm/lua-inspect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidm/lua-inspect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidm%2Flua-inspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidm%2Flua-inspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidm%2Flua-inspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidm%2Flua-inspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidm","download_url":"https://codeload.github.com/davidm/lua-inspect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidm%2Flua-inspect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27994552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T18:03:06.973Z","updated_at":"2025-12-24T04:17:48.732Z","avatar_url":"https://github.com/davidm.png","language":"Lua","funding_links":[],"categories":["Lua","资源","Resources"],"sub_categories":["Analysis Tools and ASTs","Testing"],"readme":"LuaInspect - LuaInspect is a tool that does Lua code analysis.\nIt includes an extensive plugin for the SciTE [1] text editor,\nthere is also a plugin for the VIM editor [2], and it includes\nan export to DHTML as well.\n\n== Project Page ==\n\nFor further details, see http://lua-users.org/wiki/LuaInspect .\n\n== Status ==\n\nWARNING: Some of this code might not yet be stable or complete,\nparticularly with regards to inferencing.  It is usable for daily code editing\nbut you may need to sometimes fix things yourself.  Many additional\nfeatures could be added too.\n\n== Features ==\n\n    * analysis:\n        * identifies global (red) and local variables (blue), including locals that are\n\t   function arguments (dark blue) and upvalues (light blue)\n        * identifies unused local variables: e.g. `do local x=1 end` (white-on-blue)\n        * identifies local variables masking other locals (same name): e.g. `local x=1; local x=2`\n\t   (strikethrough and squiggle line)\n        * identifies local variables that have non-constant binding (`local x = 1; x = 2`) (italic)\n        * identifies unknown global variables (white-on-red) and table fields (red), inferred by\n\t   static and dynamic evaluation.\n        * infers values of variables (e.g. `local sum = math.pi + 2` is 5.14.\n           and defined-ness of members of imported modules\n          (`local mt = require \"math\"; math.sqrtt(2) -- undefined`)\n        * infers signatures of functions (including local, global, and module functions)\n        * checks number of function arguments against signatures\n        * cross-references variables (locals and module fields) with their definitions and uses\n\t  (pink highlight), identifies range of lines/scope where the local is defined\n\t   and (SciTE only) supports jump-to-definition and jump-to-uses\n        * identifies all keywords in selected block (underline)\n        * evaluate special comments (prefixed by '!') to inject semantic information into analysis\n           (similar to luaanalyze / lint).\n        * basic type inferences (e.g. number + number -\u003e number)\n\t* infer function return values (e.g. `function f(x) if x then return 1,2,3 else return 1,3,'z' end end`\n\t   returns 1, number, unknown).\n\t* detect dead-code (e.g. `do return end dead()`) (SciTE only) (diagonal hatching)\n    * refactoring:\n        * command to rename all occurrences of selected variable (SciTE only)\n    * browsing:\n        * inspect members of selected table.\n        * select statement or comment containing current cursor selection (SciTE only)\n        * display real-time annotations of all local variables, like an Excel/Mathcad worksheet\n          (experimental feature via ANNOTATE_ALL_LOCALS) (currently SciTE only)\n    * auto-complete typing support (SciTE only) (experimental)\n    * interfaces: SciTE plugin, VIM plugin, and HTML output.\n\n== Files in this directory ==\n\nmetalualib/* - Copy of Metalua libraries.\n  Based on http://github.com/fab13n/metalua/tree/fcee97b8d0091ceb471902ee457dbccaab98234e\n  with a few bug fixes (search for \"PATCHED:LuaInspect\" in the source).\nlib/* - LuaInspect libraries.\nhtmllib/* - HTML resources under here.\nextman/* - SciTE extman.\n  Recent version compatible with LuaInspect.\n\n== Command-line Usage (HTML output) ==\n\nExample:\n\n  $ ./luainspect -fhtml -lhtmllib examples.lua \u003e examples.html\n\n(Alternately just run \"lua test.lua\".  You should also do \"lua luainspect\"\nrather than \"./luainspect\" on Windows.)\n\nYou will need to ensure that the JavaScript and CSS files in the\npath after the \"-l\" argument can be found relative to the HTML file;\notherwise, the page will not display properly.\n\n== Command-line Usage (delimited CSV output) ==\n\nExample:\n\n  $ ./luainspect -fdelimited examples.lua \u003e examples.csv\n\n== Installation in SciTE ==\n\nFirst install SciTE \u003chttp://www.scintilla.org/SciTE.html\u003e.\nVersion 2.12 and 2.20 work (older versions might not work).\n\nThe simple way to install LuaInspect into SciTE is to just place the\n\"luainspect\" folder inside the same folder where your SciTE binary is\ninstalled and add the following line to one of your SciTE properties\nfiles (e.g. SciTEGlobal.properties or SciTEUser.properties -- consult\nthe SciTE documentation for where these are located):\n\n  ext.lua.startup.script=$(SciteDefaultHome)/luainspect/extman/extman.lua\n\nThat normally is all you need to do.\n\nIf you placed LuaInspect somewhere else or are using your own version\nof SciTE ExtMan (extman.lua), you will need to adjust the above to\nreference the absolute path where extman.lua is installed.  LuaInspect\nincludes its own copy of SciTE ExtMan\n\u003chttp://lua-users.org/wiki/SciteExtMan\u003e, and it's recommended to use\nthe included version because older versions might not work\nproperly.  The files in the scite_lua subfolder are not strictly\nnecessary but are suggested.  In particularly, scite_lua/luainspect.lua\nallows ExtMan to find LuaInspect, and you will need to adjust this if\nyou move LuaInspect somewhere else relative to ExtMan.\n\nDependencies:\n  Tested with SciTE version 2.12/2.20 (older versions might not work).\n  Requires http://lua-users.org/wiki/SciteExtMan (version included).\n    Note: ExtMan's ctagsdx.lua is recommended (allows \"goto mark\"\n    command to return to previous location following a \"go to\n    definition\" or \"show all variable uses\").\n\nIf you want to customize styles, add the contents of the\n`light_styles` or `dark_styles` variable in the scite.lua file to a\nSciTE properties file.\n\n== Configuring SciTE options ==\n\nThe following LuaInspect options can be configured in one of your\nSciTE properties files:\n\n  luainspect.update.always (0 or 1, default 1)\n  luainspect.delay.count (integer \u003e= 1, default 5)\n  luainspect.annotate.all.locals (0 or 1, default 0)\n  luainspect.incremental.compilation (0 or 1, default 1)\n  luainspect.performance.tests (0 or 1, default 0)\n  luainspect.autocomplete.vars (0 or 1, default 0)\n  luainspect.autocomplete.syntax (0 or 1, default 0)\n  luainspect.path.append (string, default '')\n  luainspect.cpath.append (string, default '')\n  style.script_lua.scheme (string, '' or 'dark', default '')\n\nFor details, see scite.lua.\n\n== Installation on VIM ==\n\nSee [2] for VIM editor support.\n\n== Preliminary support for luaanalyze style comments ==\n\nTo make all variables in scope match name 'ast$' be recognized by LuaInspect as a\ntable with field 'tag' of type string, add this to your code:\n\n  --! context.apply_value('ast$', {tag=''})\n\nThe LuaInspect code itself uses this:\n\n  --! require 'luainspect.typecheck' (context)\n\n== Design Notes ==\n\nThe font styles are intended to make the more dangerous\nor questionable code stand out more.\n\nLocal variables named '_' are ignored for purposes of unused/masking variable\nreporting.  Typical use case: `for _, v in ipairs(t) do \u003c. . .\u003e end`.\n\n== LICENSE ==\n\nSee COPYRIGHT file.\n\n== Credits ==\n\nDavid Manura, original author.\nSteve Donovan for discussions on design, SciTE and ExtMan.\nFabien Fleutot for Metalua and discussions.\nSciTE suggestions/fixes by Tymur Gubayev.\nPeter Odding for VIM editor support [2].\nJon Akhtar - csv output and IntelliJ discussions.\n\n== Bugs ==\n\nPlease report bugs via github \u003chttp://github.com/davidm/lua-inspect/issues\u003e\nor just \"dee em dot el you ae at em ae tee ayche two dot ow ar gee\", or\nif you prefer neither then append to the wiki page\n\u003chttp://lua-users.org/wiki/LuaInspect\u003e.\n\n== References ==\n\n[1] http://www.scintilla.org/SciTE.html\n[2] http://peterodding.com/code/vim/lua-inspect/ - VIM editor support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidm%2Flua-inspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidm%2Flua-inspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidm%2Flua-inspect/lists"}