Skip to content

Commit

Permalink
Fix various Luacheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Snakybo committed Sep 21, 2020
1 parent 469a414 commit 3271d00
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ read_globals = {
"GetTime",
"HideUIPanel",
"InCombatLockdown",
"InterfaceOptionsFrame_OpenToCategory",
"IsAddOnLoaded",
"IsAltKeyDown",
"IsControlKeyDown",
Expand All @@ -83,13 +84,17 @@ read_globals = {
"strsplit",
"SPELLS_PER_PAGE",
"UIParent",
"UnitClass",
"UnitLevel",
"UnitName",
"UnitRace",
"WOW_PROJECT_ID",
"WOW_PROJECT_MAINLINE",
"hooksecurefunc",

-- Lua globals
"floor",
"geterrorhandler",
"error",
"ipairs",
"pairs",
Expand Down
6 changes: 3 additions & 3 deletions Config/Addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local module = {
type = "toggle",
set = function(info, val)
Clicked.db.profile.minimap.hide = not val

if val then
LibDBIcon:Show("Clicked")
else
Expand All @@ -29,10 +29,10 @@ local module = {
}
}
}

AceConfig:RegisterOptionsTable("Clicked", config)
self.options = AceConfigDialog:AddToBlizOptions("Clicked", L["NAME"])

AceConfig:RegisterOptionsTable("Clicked/Profile", AceDBOptions:GetOptionsTable(Clicked.db))
self.profile = AceConfigDialog:AddToBlizOptions("Clicked/Profile", L["OPT_PROFILES_NAME"], "Clicked")
end,
Expand Down
2 changes: 1 addition & 1 deletion Config/Bindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ local function OpenBindingConfig()
RedrawBindingConfig()
end

local module = {
module = {
--["Initialize"] = nil,

["Register"] = function(self)
Expand Down
4 changes: 2 additions & 2 deletions Config/Blacklist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local module = {
for _, frame in ipairs(Clicked:GetClickCastFrames()) do
self:OnFrameRegistered(frame)
end

AceConfig:RegisterOptionsTable("Clicked/Blacklist", self.config)
self.interfaceOptionsTab = AceConfigDialog:AddToBlizOptions("Clicked/Blacklist", L["OPT_BLACKLIST_TITLE"], "Clicked")
end,
Expand Down Expand Up @@ -48,7 +48,7 @@ local module = {
["OnFrameRegistered"] = function(self, frame)
local args = self.config.args
local name = frame:GetName()

args[name] = {
name = name,
type = "toggle",
Expand Down
2 changes: 1 addition & 1 deletion Core/Clicked.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ local function OnChatCommandReceived(input)

startpos = next
end

for _, module in pairs(modules) do
if module.OnChatCommandReceived ~= nil then
safecall(module.OnChatCommandReceived, module, args)
Expand Down
11 changes: 5 additions & 6 deletions Debug/StatusOutput.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local AceConsole = LibStub("AceConsole-3.0")
local AceGUI = LibStub("AceGUI-3.0")

local frame
Expand All @@ -19,7 +18,7 @@ local function GetBasicinfoString()
local _, name = GetSpecializationInfo(GetSpecialization())
table.insert(lines, "Specialization: " .. name)
end

do
local talents = {}

Expand Down Expand Up @@ -96,10 +95,10 @@ end
local function GetRegisteredClickCastFrames()
local lines = {}

for _, frame in ipairs(Clicked:GetClickCastFrames()) do
if frame ~= nil and frame.GetName ~= nil then
local name = frame:GetName()
local blacklisted = Clicked:IsFrameBlacklisted(frame)
for _, clickCastFrame in ipairs(Clicked:GetClickCastFrames()) do
if clickCastFrame ~= nil and clickCastFrame.GetName ~= nil then
local name = clickCastFrame:GetName()
local blacklisted = Clicked:IsFrameBlacklisted(clickCastFrame)

table.insert(lines, name .. (blacklisted and " (blacklisted)" or ""))
end
Expand Down
5 changes: 2 additions & 3 deletions UnitFrames/ClickCastFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ function Clicked:RegisterClickCastFrame(addon, frame)
self:RegisterClickCastFrameClicks(frame)
UpdateClickCastFrame(frame, cachedAttributes)

table.insert(frames, frame)
table.insert(frames, frame)

self:SendMessage(self.EVENT_CLICK_CAST_FRAME_REGISTERED, frame)
end

Expand Down Expand Up @@ -153,7 +153,6 @@ function Clicked:UnregisterClickCastFrame(frame)
self.ClickCastHeader:UnwrapScript(frame, "OnEnter")
self.ClickCastHeader:UnwrapScript(frame, "OnLeave")

local frame = frames[index]
table.remove(frames, index)

self:SendMessage(self.EVENT_CLICK_CAST_FRAME_UNREGISTERED, frame)
Expand Down

0 comments on commit 3271d00

Please sign in to comment.