Skip to content

Commit

Permalink
Address Luacheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed May 4, 2021
1 parent 411ca55 commit 54373ff
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,31 @@ ignore = {
"112/SlashCmdList",
}
globals = {
"Ambiguate",
"BADBOY_OPTIONS",
"BADBOY_BLACKLIST",
"BadBoyLog",
"C_BattleNet",
"C_CVar",
"C_FriendList",
"C_Map",
"C_ReportSystem",
"C_Timer",
"ChatFrame_AddMessageEventFilter",
"ChatFrame1",
"date",
"geterrorhandler",
"GetFramesRegisteredForEvent",
"GetLocale",
"GetTime",
"IsAltKeyDown",
"IsEncounterInProgress",
"IsGuildMember",
"PlayerLocation",
"SetCVar",
"tremove",
"UnitInParty",
"UnitInRaid",

-- Options
"ADDON_MISSING",
Expand Down
18 changes: 9 additions & 9 deletions BadBoy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ local repTbl = {
}

--[[ Chat Scanning ]]--
local Ambiguate, GetGameAccountInfoByGUID, gsub, lower, next, type, tremove = Ambiguate, C_BattleNet.GetGameAccountInfoByGUID, gsub, string.lower, next, type, tremove
local IsFriend, IsGuildMember, UnitInRaid, UnitInParty, CanComplainChat, SetCVar = C_FriendList.IsFriend, IsGuildMember, UnitInRaid, UnitInParty, CanComplainChat, SetCVar
local Ambiguate, GetGameAccountInfoByGUID, strfind, gsub, lower, next, type, tremove = Ambiguate, C_BattleNet.GetGameAccountInfoByGUID, string.find, string.gsub, string.lower, next, type, tremove
local IsFriend, IsGuildMember, UnitInRaid, UnitInParty, SetCVar, GetCVarBool = C_FriendList.IsFriend, IsGuildMember, UnitInRaid, UnitInParty, C_CVar.SetCVar, C_CVar.GetCVarBool
local CanReportPlayer, OpenReportPlayerDialog, PlayerLocation = C_ReportSystem.CanReportPlayer, C_ReportSystem.OpenReportPlayerDialog, PlayerLocation
local spamCollector, spamLogger, prevShow, enableBubble = {}, {}, 0, false
local blockedLineId, et, chatLines, chatPlayers = 0, 7, {}, {}
Expand All @@ -75,7 +75,7 @@ local function Cleanse(msg)
end
return msg
end
local eventFunc = function(_, event, msg, player, _, _, _, flag, channelId, channelNum, _, _, lineId, guid)
local eventFunc = function(_, event, msg, player, _, _, _, flag, channelId, _, _, _, lineId, guid)
-- Re-enable chat bubbles if they were disabled in the previous event.
if enableBubble then
enableBubble = false
Expand Down Expand Up @@ -243,7 +243,7 @@ do
ticker = nil
end
end)
reportFrame:SetScript("OnClick", function(self, btn)
reportFrame:SetScript("OnClick", function(self)
if IsAltKeyDown() then -- Dismiss
prevShow = GetTime() -- Refresh throttle so we don't risk showing again straight after reporting
self:GetParent():Hide()
Expand Down Expand Up @@ -298,7 +298,7 @@ do
tt:AddLine(S.clickToReport, 1, 1, 1)
if next(spamLogger) then
tt:AddLine(" ", 0.5, 0.5, 1)
for k, v in next, spamLogger do
for _, v in next, spamLogger do
tt:AddLine(v, 0.2, 1, 0)
end
end
Expand All @@ -323,14 +323,14 @@ do
for i = 1, #tbl do
local event = tbl[i]
local frames = {GetFramesRegisteredForEvent(event)}
for i = 1, #frames do
local frame = frames[i]
for j = 1, #frames do
local frame = frames[j]
frame:UnregisterEvent(event)
end
f:RegisterEvent(event)
ChatFrame_AddMessageEventFilter(event, filterFunc)
for i = 1, #frames do
local frame = frames[i]
for j = 1, #frames do
local frame = frames[j]
frame:RegisterEvent(event)
end
end
Expand Down
2 changes: 1 addition & 1 deletion Generate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local _, t = ...

t.gnt = function(u, ...)
local select, strsplit, tonumber, n, char = select, strsplit, tonumber, C_Map.GetMapInfo(u).parentMapID, string.char
local select, strsplit, tonumber, n, char = select, string.split, tonumber, C_Map.GetMapInfo(u).parentMapID, string.char
for i = 1, select("#", ...) do
local tbl = {}
local pos = 0
Expand Down

0 comments on commit 54373ff

Please sign in to comment.