From cb70ea4bbc3444dd61946249a4030d0885011b88 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Sat, 19 Oct 2024 14:35:53 -0400 Subject: [PATCH 1/5] Code cleanup --- ElitismHelper.lua | 100 ++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 53 deletions(-) diff --git a/ElitismHelper.lua b/ElitismHelper.lua index 93d08b5..f7af3d6 100644 --- a/ElitismHelper.lua +++ b/ElitismHelper.lua @@ -527,7 +527,7 @@ local Spells = { --[366409] = 20, -- Fusion Beam (Season 3 Vy Interceptor) --[373513] = 20, -- Shadow Eruption (Season 4 Zul'gamux) --[373429] = 20, -- Carrion Swarm (Season 4 Nathrezim Infiltrator) - + -- The Necrotic Wake [323957] = 20, -- Animate Dead, Warrior (Zolramus Necromancer) @@ -582,7 +582,7 @@ local Spells = { [463603] = 20, -- Coalescing Poison (Tred'ova) [326263] = 20, -- Anima Shedding (Tred'ova) - --[=====[ + --[=====[ -- De Other Side [334051] = 20, -- Erupting Darkness (Death Speaker) [328729] = 20, -- Dark Lotus (Risen Cultist) @@ -766,7 +766,7 @@ local Spells = { --]=====] - -- [**Battle for Azeroth**] + -- [**Battle for Azeroth**] -- Siege of Boralus [256627] = 20, -- Slobber Knocker (Scrimshaw Enforcer) @@ -936,7 +936,7 @@ local Spells = { --]=====] - -- [**Legion**] + -- [**Legion**] --[=====[ -- Black Rook Hold [200261] = 20, -- Bonebreaking Strike (Soul-Torn Champion / Commander Shendah'sohn) @@ -1044,7 +1044,7 @@ local Spells = { [198263] = 20, -- Radiant Tempest (Odyn) [198088] = 20, -- Glowing Fragment (Odyn) [198412] = 20, -- Feedback (Odyn) - + -- Return to Karazhan: Lower [228001] = 20, -- Pennies From Heaven (Ghostly Philanthropist) @@ -1175,7 +1175,7 @@ local Spells = { --]=====] - -- [**Mist of Pandaria**] + -- [**Mist of Pandaria**] --[=====[ -- Temple of the Jade Serpent [397881] = 20, -- Surging Deluge (Corrupt Living Water) @@ -1290,7 +1290,7 @@ local SpellsNoTank = { [450055] = 20, -- Gutburst (Ravenous Scarab, Izo the Grand Splicer) - is this reasonable? -- [**Dragonflight**] - --[=====[ + --[=====[ -- Uldaman: Legacy of Tyr [369409] = 20, -- Cleave (Earthen Custodian) [369563] = 20, -- Wild Cleave (Baelog, The Lost Dwarves) @@ -1306,7 +1306,7 @@ local SpellsNoTank = { -- Brackenhide Hollow [382712] = 20, -- Necrotic Breath, Initial (Wilted Oak) [382805] = 20, -- Necrotic Breath, DoT (Wilted Oak) - --[374544] = 20, -- Burst of Decay (Fetid Rotsinger) - TODO does this only target tank? + --[374544] = 20, -- Burst of Decay (Fetid Rotsinger) - TODO does this only target tank? [377807] = 20, -- Cleave (Rira Hackclaw) [381419] = 20, -- Savage Charge (Rira Hackclaw) [377559] = 20, -- Vine Whip (Treemouth) @@ -1367,8 +1367,8 @@ local SpellsNoTank = { -- Tazavesh: Streets of Wonder -- Tazavesh: So'leah's Gambit --]=====] - - + + -- [**Battle for Azeroth**] -- Siege of Boralus --[273720] = 20, -- Heavy Ordnance, Contact (Chopper Redhook) - is this reasonable? @@ -1381,9 +1381,9 @@ local SpellsNoTank = { -- Operation: Mechagon - Junkyard -- Operation: Mechagon - Workshop [294291] = 20, -- Process Waste (Waste Processing Unit) - --]=====] + --]=====] + - -- [**Legion**] --[=====[ -- Black Rook Hold @@ -1404,7 +1404,7 @@ local SpellsNoTank = { [205609] = 20, -- Rancid Maw (Naraxas) - TODO ID? [200721] = 20, -- Landslide (Dargrul) - -- Court of Stars + -- Court of Stars [209036] = 20, -- Throw Torch (Duskwatch Sentry) [209495] = 20, -- Charged Smash (Guardian Construct) [209512] = 20, -- Disrupting Energy (Guardian Construct) @@ -1422,7 +1422,7 @@ local SpellsNoTank = { --]=====] - -- [**Warlords of Draenor**] + -- [**Warlords of Draenor**] --[=====[ -- The Everbloom [164357] = 20, -- Parched Gasp (Witherbark) @@ -1446,7 +1446,7 @@ local SpellsNoTank = { [164163] = 20, -- Hewing Swipe (Grimrail Overseer) --]=====] - -- [**Mist of Pandaria**] + -- [**Mist of Pandaria**] -- Temple of the Jade Serpent @@ -1474,17 +1474,17 @@ local Auras = { -- [**Dragonflight**] --[=====[ -- Uldaman: Legacy of Tyr - [372652] = true, -- Resonating Orb (Sentinel Talondras) + [372652] = true, -- Resonating Orb (Sentinel Talondras) - -- The Azure Vault - [386368] = true, -- Polymorphed (Polymorphic Rune, Environment) - [396722] = true, -- Absolute Zero, Root (Telash Greywing) + -- The Azure Vault + [386368] = true, -- Polymorphed (Polymorphic Rune, Environment) + [396722] = true, -- Absolute Zero, Root (Telash Greywing) - -- Dawn of the Infinite: Galakrond's Fall - [418346] = true, -- Corrupted Mind (Blight of Galakrond) + -- Dawn of the Infinite: Galakrond's Fall + [418346] = true, -- Corrupted Mind (Blight of Galakrond) - -- Dawn of the Infinite: Murozond's Rise - [401667] = true, -- Time Stasis (Morchie) + -- Dawn of the Infinite: Murozond's Rise + [401667] = true, -- Time Stasis (Morchie) --]=====] @@ -1493,7 +1493,7 @@ local Auras = { -- Affixes seasons --[358973] = true, -- Wave of Terror (Season 2 Affix - Varruth) --[373391] = true, -- Nightmare (Season 4 Affix - Nightmare Cloud) - + -- The Necrotic Wake [324293] = true, -- Rasping Scream (Skeletal Marauder) @@ -1519,23 +1519,23 @@ local Auras = { -- Tazavesh: Streets of Wonder - -- Tazavesh: So'leah's Gambit + -- Tazavesh: So'leah's Gambit --]=====] - - -- [**Battle for Azeroth**] + + -- [**Battle for Azeroth**] -- Siege of Boralus [257169] = true, -- Terrifying Roar (Bilge Rat Demolisher) [274942] = true, -- Banana Rampage (Bilge Rat Buccaneer) - --[=====[ + --[=====[ -- Waycrest Manor [265352] = true, -- Toad Blight (Blight Toad) [278468] = true, -- Freezing Trap (Maddened Survivalist) - + -- Atal'Dazar [257483] = true, -- Pile of Bones (Environment, Rezan) [255371] = true, -- Terrifying Visage (Rezan) - + -- Freehold [274516] = true, -- Slippery Suds (Bilge Rat Swabby) [272554] = true, -- Bloody Mess (Trothak, Ring of Booty) @@ -1561,9 +1561,9 @@ local Auras = { [214987] = true, -- Righteous Indignation (Suspicious Noble) - TODO find ID for stun [224333] = true, -- Enveloping Winds (Advisor Melandrus) --]=====] - + -- [**Warlords of Draenor**] - --[=====[ + --[=====[ -- The Everbloom [169179] = true, -- Colossal Blow (Yalnu) @@ -1574,7 +1574,7 @@ local Auras = { --]=====] - -- [**Mist of Pandaria**] + -- [**Mist of Pandaria**] } @@ -1627,10 +1627,6 @@ ElitismFrame.text:SetAllPoints() ElitismFrame.text:SetTextHeight(13) ElitismFrame:SetAlpha(1) -function table.pack(...) - return { n = select("#", ...), ... } -end - ElitismFrame:SetScript("OnEvent", function(self, event_name, ...) if self[event_name] then return self[event_name](self, event_name, ...) @@ -1655,7 +1651,7 @@ function generateMaybeOutput(user) end if minPct == math.huge then local spellNames = " " - for spellId,amount in pairs(TimerData[user]) do + for spellId in pairs(TimerData[user]) do print("Getting spellId "..spellId) local spellLink = C_Spell.GetSpellLink(spellId) spellNames = spellNames..spellLink.." " @@ -1751,7 +1747,7 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) for k,v in pairs(Users) do local out = "" out = out..k - for i, m in ipairs(v) do + for _, m in ipairs(v) do out = out..";;;"..m end print(out) @@ -1869,7 +1865,7 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) --print("hits for " .. name) maybeSendChatMessage("Hits for "..name) - local delay = 0; + local delay = 0 for k,v in pairs(FailByAbility[name]) do --print(v.cnt .. "x" .. GetSpellLink(k) .. " = " .. round(v.sum / 1000, 1) .. "k; " .. delay) @@ -1950,7 +1946,7 @@ function ElitismFrame:RebuildTable() end end -function ElitismFrame:ADDON_LOADED(event,addon) +function ElitismFrame:ADDON_LOADED(_, addon) if addon == "ElitismHelper" then ElitismFrame:RebuildTable() @@ -1967,12 +1963,12 @@ function ElitismFrame:ADDON_LOADED(event,addon) end end -function ElitismFrame:GROUP_ROSTER_UPDATE(event,...) +function ElitismFrame:GROUP_ROSTER_UPDATE() -- print("GROUP_ROSTER_UPDATE") ElitismFrame:RebuildTable() end -function ElitismFrame:ZONE_CHANGED_NEW_AREA(event,...) +function ElitismFrame:ZONE_CHANGED_NEW_AREA() -- print("ZONE_CHANGED_NEW_AREA") ElitismFrame:RebuildTable() end @@ -1981,12 +1977,12 @@ function compareDamage(a,b) return a["value"] < b["value"] end -function ElitismFrame:CHALLENGE_MODE_COMPLETED(event,...) +function ElitismFrame:CHALLENGE_MODE_COMPLETED() if ElitismHelperDB.EndOfDungeonMessage then local count = 0 for _ in pairs(CombinedFails) do count = count + 1 end if count == 0 then - print("No Damage?"); + print("No Damage?") --maybeSendChatMessage("Thank you for travelling with ElitismHelper.) --maybeSendChatMessage(" No avoidable damage was taken this run.") return @@ -2003,7 +1999,7 @@ function ElitismFrame:CHALLENGE_MODE_COMPLETED(event,...) end end -function ElitismFrame:CHALLENGE_MODE_START(event,...) +function ElitismFrame:CHALLENGE_MODE_START() CombinedFails = {} FailByAbility = {} print("Avoidable damage now being recorded.") @@ -2051,7 +2047,7 @@ function ElitismFrame:CHAT_MSG_ADDON(event,...) if compareSemver(incomingVersion, activeVersion) > 0 then activeUserObject = {k, v} end - + --Use alphabet as tie breaker if(activeUserObject[2][2] == v[2]) then if k < activeUserObject[1] then @@ -2068,8 +2064,6 @@ function ElitismFrame:CHAT_MSG_ADDON(event,...) else activeUser = activeUserObject[1] end - else - -- print("Unknown message: "..message) end end @@ -2160,11 +2154,11 @@ function ElitismFrame:AuraApply(timestamp, eventType, srcGUID, srcName, srcFlags end end -function ElitismFrame:COMBAT_LOG_EVENT_UNFILTERED(event,...) - local timestamp, eventType, hideCaster, srcGUID, srcName, srcFlags, srcFlags2, dstGUID, dstName, dstFlags, dstFlags2 = CombatLogGetCurrentEventInfo(); -- Those arguments appear for all combat event variants. - local eventPrefix, eventSuffix = eventType:match("^(.-)_?([^_]*)$"); +function ElitismFrame:COMBAT_LOG_EVENT_UNFILTERED() + local timestamp, eventType, hideCaster, srcGUID, srcName, srcFlags, srcFlags2, dstGUID, dstName, dstFlags, dstFlags2 = CombatLogGetCurrentEventInfo() -- Those arguments appear for all combat event variants. + local eventPrefix, eventSuffix = eventType:match("^(.-)_?([^_]*)$") if (eventPrefix:match("^SPELL") or eventPrefix:match("^RANGE")) and eventSuffix == "DAMAGE" then - local spellId, spellName, spellSchool, sAmount, aOverkill, sSchool, sResisted, sBlocked, sAbsorbed, sCritical, sGlancing, sCrushing, sOffhand, _ = select(12, CombatLogGetCurrentEventInfo()) + local spellId, spellName, spellSchool, sAmount, aOverkill, sSchool, sResisted, sBlocked, sAbsorbed, sCritical, sGlancing, sCrushing, sOffhand = select(12, CombatLogGetCurrentEventInfo()) ElitismFrame:SpellDamage(timestamp, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellId, spellName, spellSchool, sAmount) elseif eventPrefix:match("^SWING") and eventSuffix == "DAMAGE" then local aAmount, aOverkill, aSchool, aResisted, aBlocked, aAbsorbed, aCritical, aGlancing, aCrushing, aOffhand, _ = select(12, CombatLogGetCurrentEventInfo()) From ada8641a7c1ca6cf91f0cf463599da70d95846a0 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Sat, 19 Oct 2024 14:37:00 -0400 Subject: [PATCH 2/5] Don't leak globals --- ElitismHelper.lua | 116 +++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/ElitismHelper.lua b/ElitismHelper.lua index f7af3d6..3e165f5 100644 --- a/ElitismHelper.lua +++ b/ElitismHelper.lua @@ -1604,7 +1604,7 @@ local function compareSemver(ver1, ver2) return 0 end -function round(number, decimals) +local function round(number, decimals) return (("%%.%df"):format(decimals)):format(number) end @@ -1633,7 +1633,54 @@ ElitismFrame:SetScript("OnEvent", function(self, event_name, ...) end end) -function generateMaybeOutput(user) +local function maybeSendAddonMessage(prefix, message) + if IsInGroup() and not IsInGroup(2) and not IsInRaid() then + C_ChatInfo.SendAddonMessage(prefix,message,"PARTY") + elseif IsInGroup() and not IsInGroup(2) and IsInRaid() then + C_ChatInfo.SendAddonMessage(prefix,message,"RAID") + end +end + +local function maybeSendChatMessage(message) + if activeUser ~= playerUser then + return + end + if ElitismHelperDB.OutputMode == "self" then + print(message) + elseif ElitismHelperDB.OutputMode == "party" and IsInGroup() and not IsInGroup(2) then + SendChatMessage(message,"PARTY") + elseif ElitismHelperDB.OutputMode == "raid" and IsInGroup() and not IsInGroup(2) and IsInRaid() then + SendChatMessage(message,"RAID") + elseif ElitismHelperDB.OutputMode == "yell" then + SendChatMessage(message,"YELL") + elseif ElitismHelperDB.OutputMode == "emote" then + SendChatMessage(message,"EMOTE") + elseif ElitismHelperDB.OutputMode:find('^channel') ~= nil then + local args = ElitismFrame:SplitString(ElitismHelperDB.OutputMode," ") + if(args[2] == nil) then + print("ERROR: Invalid channel string in ElitismHelperDB!") + return + end + SendChatMessage(message,"CHANNEL",GetDefaultLanguage(),args[2]) + elseif ElitismHelperDB.OutputMode == "default" then + if IsInGroup() and not IsInGroup(2) and not IsInRaid() then + SendChatMessage(message,"PARTY") + elseif IsInGroup() and not IsInGroup(2) and IsInRaid() then + SendChatMessage(message,"RAID") + end + end +end + +local function delayMaybeSendChatMessage(message, delay) + C_Timer.After( + delay, + function() + maybeSendChatMessage(message) + end + ) +end + +local function generateMaybeOutput(user) local func = function() local msg = " "..user.." got hit by " local sending = false @@ -1684,7 +1731,7 @@ function generateMaybeOutput(user) return func end -function generateMaybeMeleeOutput(user) +local function generateMaybeMeleeOutput(user) local func = function() local msg = " "..user.." got hit by " local sending = false @@ -1712,7 +1759,7 @@ end SLASH_ELITISMHELPER1 = "/eh" SlashCmdList["ELITISMHELPER"] = function(msg,editBox) - function enableElitismHelper() + local function enableElitismHelper() if ElitismHelperDB.Loud then print("ElitismHelper: Damage notifications are already enabled.") else @@ -1720,7 +1767,7 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) print("ElitismHelper: All damage notifications enabled.") end end - function disableElisitmHelper() + local function disableElitismHelper() if not ElitismHelperDB.Loud then print("ElitismHelper: Damage notifications are already disabled.") else @@ -1733,7 +1780,7 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) end end - actions = { + local actions = { ["activeUser"] = function() print("activeUser is "..activeUser) if activeUser == playerUser then @@ -1777,8 +1824,8 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) end, ["on"] = enableElitismHelper, ["enable"] = enableElitismHelper, - ["off"] = disableElisitmHelper, - ["disable"] = disableElisitmHelper, + ["off"] = disableElitismHelper, + ["disable"] = disableElitismHelper, ["output"] = function(argsFunc) if argsFunc == "default" then ElitismHelperDB.OutputMode = "default" @@ -1827,7 +1874,7 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) print(" messageTest : Testing output") end, ["threshold"] = function(args) - thresholdNumber = tonumber(args, 10) + local thresholdNumber = tonumber(args, 10) if thresholdNumber == nil then print("Sets threshold of health lost to notify on (as percentage): `/eh threshold 100` will show notifications for one-shot damage (> 100%)") print(" Current Threshold: " .. ElitismHelperDB.Threshold) @@ -1886,53 +1933,6 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) commandFunction(args) end -function maybeSendAddonMessage(prefix, message) - if IsInGroup() and not IsInGroup(2) and not IsInRaid() then - C_ChatInfo.SendAddonMessage(prefix,message,"PARTY") - elseif IsInGroup() and not IsInGroup(2) and IsInRaid() then - C_ChatInfo.SendAddonMessage(prefix,message,"RAID") - end -end - -function maybeSendChatMessage(message) - if activeUser ~= playerUser then - return - end - if ElitismHelperDB.OutputMode == "self" then - print(message) - elseif ElitismHelperDB.OutputMode == "party" and IsInGroup() and not IsInGroup(2) then - SendChatMessage(message,"PARTY") - elseif ElitismHelperDB.OutputMode == "raid" and IsInGroup() and not IsInGroup(2) and IsInRaid() then - SendChatMessage(message,"RAID") - elseif ElitismHelperDB.OutputMode == "yell" then - SendChatMessage(message,"YELL") - elseif ElitismHelperDB.OutputMode == "emote" then - SendChatMessage(message,"EMOTE") - elseif ElitismHelperDB.OutputMode:find('^channel') ~= nil then - local args = ElitismFrame:SplitString(ElitismHelperDB.OutputMode," ") - if(args[2] == nil) then - print("ERROR: Invalid channel string in ElitismHelperDB!") - return - end - SendChatMessage(message,"CHANNEL",GetDefaultLanguage(),args[2]) - elseif ElitismHelperDB.OutputMode == "default" then - if IsInGroup() and not IsInGroup(2) and not IsInRaid() then - SendChatMessage(message,"PARTY") - elseif IsInGroup() and not IsInGroup(2) and IsInRaid() then - SendChatMessage(message,"RAID") - end - end -end - -function delayMaybeSendChatMessage(message, delay) - C_Timer.After( - delay, - function() - maybeSendChatMessage(message) - end - ) -end - function ElitismFrame:RebuildTable() Users = {} activeUser = nil @@ -1940,7 +1940,7 @@ function ElitismFrame:RebuildTable() if IsInGroup() then maybeSendAddonMessage(MSG_PREFIX,"VREQ") else - name = GetUnitName("player",true) + local name = GetUnitName("player", true) activeUser = name.."-"..GetRealmName() -- print("We are alone, activeUser: "..activeUser) end @@ -1973,7 +1973,7 @@ function ElitismFrame:ZONE_CHANGED_NEW_AREA() ElitismFrame:RebuildTable() end -function compareDamage(a,b) +local function compareDamage(a,b) return a["value"] < b["value"] end From a54d011d54bab04cc7d7538e7e14630215c62494 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Sat, 19 Oct 2024 14:37:11 -0400 Subject: [PATCH 3/5] Remove duplicate spell entry --- ElitismHelper.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/ElitismHelper.lua b/ElitismHelper.lua index 3e165f5..0d3f17a 100644 --- a/ElitismHelper.lua +++ b/ElitismHelper.lua @@ -155,7 +155,6 @@ local Spells = { [425554] = 20, -- Purify (Prioress Murrpray) [425556] = 20, -- Sanctified Ground (Prioress Murrpray) [428170] = 20, -- Blinding Light, Disorient (Prioress Murrpray) - [425556] = 20, -- Sanctified Ground (Prioress Murrpray) -- The Dawnbreaker From e954c6684a9b36b7ebba737e3e4f9d0ade1665f6 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Sat, 19 Oct 2024 14:37:43 -0400 Subject: [PATCH 4/5] Fix spell linking for `/eh list` --- ElitismHelper.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElitismHelper.lua b/ElitismHelper.lua index 0d3f17a..e3f36c6 100644 --- a/ElitismHelper.lua +++ b/ElitismHelper.lua @@ -1903,7 +1903,7 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) for player,fails in pairs(FailByAbility) do print("Hits for "..player) for k,v in pairs(fails) do - local spellLink = C_Spell.GetSpellLink(spellId) + local spellLink = C_Spell.GetSpellLink(k) print(" " .. v.cnt .. "x" .. spellLink .. " = " .. round(v.sum / 1000, 1) .. "k") end end @@ -1916,7 +1916,7 @@ SlashCmdList["ELITISMHELPER"] = function(msg,editBox) for k,v in pairs(FailByAbility[name]) do --print(v.cnt .. "x" .. GetSpellLink(k) .. " = " .. round(v.sum / 1000, 1) .. "k; " .. delay) --maybeSendChatMessage(v.cnt .. "x" .. GetSpellLink(k) .. " = " .. round(v.sum / 1000, 1) .. "k") - local spellLink = C_Spell.GetSpellLink(spellId) + local spellLink = C_Spell.GetSpellLink(k) delayMaybeSendChatMessage(v.cnt .. "x" .. spellLink .. " = " .. round(v.sum / 1000, 1) .. "k", delay * 0.1) delay = delay + 1 end From e32778d51b9d0c6067dd0987f3d14587f4aa4547 Mon Sep 17 00:00:00 2001 From: Nick Towle Date: Sat, 19 Oct 2024 14:37:54 -0400 Subject: [PATCH 5/5] Add luacheck workflows --- .github/workflows/pull_request.yml | 16 ++++++++++++++++ .github/workflows/push.yml | 21 +++++++++++++++++++++ .luacheckrc | 28 ++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .github/workflows/pull_request.yml create mode 100644 .github/workflows/push.yml create mode 100644 .luacheckrc diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..0e0441d --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,16 @@ +name: Check Pull Request + +on: [pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Clone project + uses: actions/checkout@v4 + + - name: Run luacheck + uses: BigWigsMods/actions/luacheck@master + with: + args: -q diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..57368c0 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,21 @@ +name: Push + +on: + push: + paths-ignore: + - '.github/**' + - '*.md' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Clone project + uses: actions/checkout@v4 + + - name: Run luacheck + uses: BigWigsMods/actions/luacheck@master + with: + args: -q diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..bfa6c95 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,28 @@ +td = "lua51" +max_line_length = false +codes = true +ignore = { + "2", + "4" +} +globals = { + "C_ChatInfo", + "C_Spell", + "C_Timer", + "CombatLogGetCurrentEventInfo", + "CreateFrame", + "ElitismHelperDB", + "GetDefaultLanguage", + "GetRealmName", + "GetUnitName", + "IsInGroup", + "IsInRaid", + "Round", + "SendChatMessage", + "SlashCmdList", + "SLASH_ELITISMHELPER1", + "strsplit", + "UnitGroupRolesAssigned", + "UnitHealthMax", + "UnitIsPlayer" +}