-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Luacheck and corresponding workflow
- Loading branch information
Showing
7 changed files
with
143 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Validate Lua Files | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
validate-lua: | ||
|
||
container: | ||
image: woahbase/alpine-lua:5.2.4 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: apk add --update gcc alpine-sdk | ||
|
||
- name: Install luacheck | ||
run: luarocks install luacheck | ||
|
||
- name: Run luacheck | ||
run: luacheck ./Prisma/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
std = { | ||
globals = {"init", "update", "uninit", "sb", "string", "localAnimator", "_ENV"}, | ||
read_globals = {"type", "pairs", "require"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
local _init = init or function() end | ||
local _update = update or function() end | ||
local _uninit = uninit or function() end | ||
local _init = init or function() | ||
end; | ||
local _update = update or function() | ||
end; | ||
local _uninit = uninit or function() | ||
end; | ||
|
||
string.prisma = string.prisma or {} | ||
string.prisma = string.prisma or {}; | ||
|
||
function init(...) | ||
return _init(...) | ||
end | ||
|
||
return _init(...); | ||
end; | ||
function update(...) | ||
return _update(...) | ||
end | ||
|
||
return _update(...); | ||
end; | ||
function uninit(...) | ||
return _uninit(...) | ||
end | ||
return _uninit(...); | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
local _init = init or function() end | ||
local _update = update or function() end | ||
local _uninit = uninit or function() end | ||
local _init = init or function() | ||
end; | ||
local _update = update or function() | ||
end; | ||
local _uninit = uninit or function() | ||
end; | ||
|
||
string.prisma = string.prisma or {} | ||
string.prisma = string.prisma or {}; | ||
|
||
function init(...) | ||
string.prisma.localAnimator = localAnimator | ||
return _init(...) | ||
end | ||
|
||
string.prisma.localAnimator = localAnimator; | ||
return _init(...); | ||
end; | ||
function update(...) | ||
return _update(...) | ||
end | ||
|
||
return _update(...); | ||
end; | ||
function uninit(...) | ||
return _uninit(...) | ||
end | ||
return _uninit(...); | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
require("/prisma/debug/log.lua") | ||
require("/prisma/debug/log.lua"); | ||
|
||
local _init = init or function() end | ||
local _update = update or function() end | ||
local _uninit = uninit or function() end | ||
local _init = init or function() | ||
end; | ||
local _update = update or function() | ||
end; | ||
local _uninit = uninit or function() | ||
end; | ||
|
||
local firstSuccessUpdate = true -- boolean | ||
local firstSuccessUpdate = true; | ||
|
||
|
||
string.prisma = string.prisma or {} | ||
string.prisma.debug = string.prisma.debug or {} | ||
--if _SBLOADED["/prisma/debug/log.lua"] then | ||
string.prisma.debug.enabled = false | ||
--end | ||
string.prisma = string.prisma or {}; | ||
string.prisma.debug = string.prisma.debug or {}; | ||
string.prisma.debug.enabled = false; | ||
|
||
function init(...) | ||
return _init(...) | ||
end | ||
return _init(...); | ||
end; | ||
|
||
function update(...) | ||
if not localAnimator then | ||
localAnimator = string.prisma.localAnimator | ||
elseif firstSuccessUpdate then | ||
sb.logInfo("Got the LocalAnimator!") | ||
firstSuccessUpdate = false | ||
string.prisma.debug.log.DetailedTableTree(_ENV, "") | ||
end | ||
return _update(...) | ||
end | ||
if not localAnimator then | ||
localAnimator = string.prisma.localAnimator; | ||
elseif firstSuccessUpdate then | ||
sb.logInfo("Got the LocalAnimator!"); | ||
firstSuccessUpdate = false; | ||
string.prisma.debug.log.DetailedTableTree(_ENV, ""); | ||
end; | ||
return _update(...); | ||
end; | ||
|
||
function uninit(...) | ||
return _uninit(...) | ||
end | ||
return _uninit(...); | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
local _init = init or function() end | ||
local _update = update or function() end | ||
local _uninit = uninit or function() end | ||
local _init = init or function() | ||
end; | ||
local _update = update or function() | ||
end; | ||
local _uninit = uninit or function() | ||
end; | ||
|
||
string.prisma = string.prisma or {} | ||
string.prisma = string.prisma or {}; | ||
|
||
function init(...) | ||
return _init(...) | ||
end | ||
return _init(...); | ||
end; | ||
|
||
function update(...) | ||
return _update(...) | ||
end | ||
return _update(...); | ||
end; | ||
|
||
function uninit(...) | ||
return _uninit(...) | ||
end | ||
return _uninit(...); | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
string.prisma = string.prisma or {}; | ||
string.prisma.debug = string.prisma.debug or {}; | ||
string.prisma.debug.log = {}; | ||
|
||
string.prisma = string.prisma or {} | ||
string.prisma.debug = string.prisma.debug or {} | ||
string.prisma.debug.log = {} | ||
function string.prisma.debug.log.tableList(node, displayString) | ||
if not string.prisma.debug.enabled then | ||
return; | ||
end; | ||
if type(node) == "table" then | ||
for nodeName, nodeType in pairs(node) do | ||
sb.logInfo("%s%s : %s", displayString, nodeName, type(nodeType)); | ||
string.prisma.debug.log.tableList(nodeType, displayString .. nodeName .. "."); | ||
end; | ||
end; | ||
end; | ||
|
||
function string.prisma.debug.log.TableList(e, p) | ||
if not string.prisma.debug.enabled then | ||
return | ||
end | ||
if type(e) == "table" then | ||
for k, v in pairs(e) do | ||
sb.logInfo("%s%s : %s",p,k, type(v)) | ||
--sb.logInfo("%s",v) | ||
string.prisma.debug.log.TableList(v,p .. k .. ".") | ||
end | ||
end | ||
end | ||
function string.prisma.debug.log.tableTree(node, displayString) | ||
if not string.prisma.debug.enabled then | ||
return; | ||
end; | ||
if type(node) == "table" then | ||
for nodeName, nodeType in pairs(node) do | ||
local arrow = ""; | ||
if displayString ~= "" then | ||
arrow = "└>"; | ||
end; | ||
sb.logInfo("%s%s %s : %s", displayString, arrow, nodeName, type(nodeType)); | ||
string.prisma.debug.log.tableTree(nodeType, displayString .. " "); | ||
end; | ||
end; | ||
end; | ||
|
||
function string.prisma.debug.log.TableTree(e, p) | ||
if not string.prisma.debug.enabled then | ||
return | ||
end | ||
if type(e) == "table" then | ||
for k, v in pairs(e) do | ||
local arrow = "" | ||
if p ~= "" then | ||
arrow = "└>" | ||
end | ||
sb.logInfo("%s%s %s : %s",p,arrow,k, type(v)) | ||
--sb.logInfo("%s",v) | ||
string.prisma.debug.log.TableTree(v,p .. " ") | ||
end | ||
end | ||
end | ||
|
||
function string.prisma.debug.log.DetailedTableTree(e, p) | ||
if not string.prisma.debug.enabled then | ||
return | ||
end | ||
if type(e) == "table" then | ||
for k, v in pairs(e) do | ||
local arrow = "" | ||
if p ~= "" then | ||
arrow = "└>" | ||
end | ||
sb.logInfo("%s%s %s : %s",p,arrow,k, type(v)) | ||
if type(v) ~= "table" and type(v) ~= "function" then | ||
sb.logInfo("%s %s",p,v) | ||
end | ||
string.prisma.debug.log.DetailedTableTree(v,p .. " ") | ||
end | ||
end | ||
end | ||
function string.prisma.debug.log.detailedTableTree(node, displayString) | ||
if not string.prisma.debug.enabled then | ||
return; | ||
end; | ||
if type(node) == "table" then | ||
for nodeName, nodeType in pairs(node) do | ||
local arrow = ""; | ||
if displayString ~= "" then | ||
arrow = "└>"; | ||
end; | ||
sb.logInfo("%s%s %s : %s", displayString, arrow, nodeName, type(nodeType)); | ||
if type(nodeType) ~= "table" and type(nodeType) ~= "function" then | ||
sb.logInfo("%s %s", displayString, nodeType); | ||
end; | ||
string.prisma.debug.log.detailedTableTree(nodeType, displayString .. " "); | ||
end; | ||
end; | ||
end; | ||
|
||
function string.prisma.debug.log.info() | ||
sb.logInfo(); | ||
end; |