{"id":13780121,"url":"https://github.com/philips/lualint","last_synced_at":"2025-08-02T11:32:32.718Z","repository":{"id":3105307,"uuid":"4131282","full_name":"philips/lualint","owner":"philips","description":"lua linter","archived":false,"fork":false,"pushed_at":"2023-06-30T11:38:31.000Z","size":156,"stargazers_count":85,"open_issues_count":4,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T18:54:39.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/philips.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-04-25T00:25:19.000Z","updated_at":"2024-10-05T15:22:48.000Z","dependencies_parsed_at":"2024-01-15T09:05:18.150Z","dependency_job_id":"88f72b07-5667-4e0a-a6f5-1b1d7d8553b3","html_url":"https://github.com/philips/lualint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/philips/lualint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Flualint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Flualint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Flualint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Flualint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philips","download_url":"https://codeload.github.com/philips/lualint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Flualint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378965,"owners_count":24240907,"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-08-02T02:00:12.353Z","response_time":74,"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-03T18:01:12.550Z","updated_at":"2025-08-02T11:32:32.458Z","avatar_url":"https://github.com/philips.png","language":"Lua","readme":"lualint performs luac-based static analysis of global variable usage in Lua\nsource code.\n\n`Usage: lualint [-r|-s] filename.lua [ [-r|-s] [filename.lua] ...]`\n\n## Description\n\nlualint uses luac's bytecode listing. It reports all accesses to undeclared\nglobal variables, which catches many typing errors in variable names. For\nexample:\n\n    local really_aborting\n    local function abort() os.exit(1) end\n    if not os.getenv(\"HOME\") then\n      realy_aborting = true\n      abortt()\n    end\n    reports:\n\n    /tmp/example.lua:4: *** global SET of realy_aborting\n    /tmp/example.lua:5: global get of abortt\n\nIt is primarily designed for use on LTN7-style modules, where each source file\nonly exports one global symbol. (A module contained in the file \"foobar.lua\"\nshould only export the symbol \"foobar\".)\n\nA \"relaxed\" mode is available for source not in LTN7 style. It only detects\nreads from globals that were never set. The switch \"-r\" puts lualint into\nrelaxed mode for the following files; \"-s\" switches back to strict.\n\nRequired packages are tracked, although not recursively. If you call\n\"myext.process()\" you should require \"myext\", and not depend on other\ndependencies to load it. LUA_PATH is followed as usual to find requirements.\n\nSome (not strictly LTN7) modules may wish to export other variables into the\nglobal environment. To do so, use the declare function:\n\n    declare \"xpairs\"\n    function xpairs(node)\n      [...]\n\nSimilarly, to quiet warnings about reading global variables you are aware may\nbe unavailable:\n\n    lint_ignore \"lua_fltk_version\"\n    if lua_fltk_version then print(\"fltk loaded\") end\n\nOne way of defining these is in a module \"declare.lua\":\n\n    function declare(s)\n    end\n    declare \"lint_ignore\"\n    function lint_ignore(s)\n    end\n\n(Setting declare is OK, because it's in the \"declare\" module.) These functions\ndon't have to do anything, or in fact actually exist! They can be in dead code:\n\n    if false then declare \"xpairs\" end\n\nThis is because lualint only performs a rather primitive and cursory scan of\nthe bytecode. Perhaps declarations should only be allowed in the main chunk.\n\n## TODO\n\nThe errors don't come out in any particular order.\n\nShould switch to RiciLake's parser, which should do a much better job of this\nand allow detection of some other common situations.\n\n## CREDITS\n\nJayCarlson (nop@nop.com)\n\nThis is all Ben Jackson's (ben@ben.com) fault, who did some similar tricks in\nMOO.\n","funding_links":[],"categories":["Linters","Programming Languages","Resources","Code Analysis and Linter"],"sub_categories":["Lua","Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips%2Flualint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilips%2Flualint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips%2Flualint/lists"}