Skip to content

Commit 5d49077

Browse files
committed
Update .luacheckrc
1 parent 97b1ff1 commit 5d49077

File tree

11 files changed

+125
-31
lines changed

11 files changed

+125
-31
lines changed

.luacheckrc

Lines changed: 112 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,119 @@
11
std = "lua51"
22
max_line_length = false
33
exclude_files = {
4-
"**/libs/**",
54
".luacheckrc"
65
}
76
ignore = {
8-
"111", -- Setting an undefined global variable
9-
"112", -- Mutating an undefined global variable
10-
"113", -- Accessing an undefined global variable
11-
"143", -- Accessing an undefined field of a global variable
12-
"212/self", -- Unused argument self
13-
"212/event", -- Unused argument event
14-
"213", -- Unused loop variable
7+
"212/self",
8+
"212/event",
9+
}
10+
globals = {
11+
-- Variables
12+
"ATTACHMENTS_MAX_RECEIVE",
13+
"ATTACHMENTS_MAX_SEND",
14+
"BUYBACK_ITEMS_PER_PAGE",
15+
"EQUIPMENTFLYOUT_FIRST_SPECIAL_LOCATION",
16+
"INBOXITEMS_TO_DISPLAY",
17+
"ITEM_LEVEL",
18+
"ITEM_QUALITY_COLORS",
19+
"MAX_GUILDBANK_SLOTS_PER_TAB",
20+
"MAX_NUM_ITEMS",
21+
"MAX_TRADE_ITEMS",
22+
"MERCHANT_ITEMS_PER_PAGE",
23+
"NUM_BANKGENERIC_SLOTS",
24+
"RAID_CLASS_COLORS",
25+
"VOID_DEPOSIT_MAX",
26+
"VOID_WITHDRAW_MAX",
27+
"WOW_PROJECT_CLASSIC",
28+
"WOW_PROJECT_ID",
29+
"WOW_PROJECT_MAINLINE",
30+
31+
-- Globals
32+
"Bagnon",
33+
"BankFrame",
34+
"CharacterFrame",
35+
"ContainerFrameCombinedBags",
36+
"EncounterJournal",
37+
"EquipmentFlyoutFrame",
38+
"GameFontHighlight",
39+
"GameTooltip",
40+
"GuildBankFrame",
41+
"InboxFrame",
42+
"InspectFrame",
43+
"InterfaceOptionsFramePanelContainer",
44+
"ItemUpgradeFrame",
45+
"LibStub",
46+
"LiteBag_RegisterHook",
47+
"LootFrame",
48+
"MerchantBuyBackItemItemButton",
49+
"MerchantFrame",
50+
"QuestInfoFrame",
51+
"QuestInfoRewardsFrame",
52+
"ScrappingMachineFrame",
53+
"SyLevel",
54+
"SyLevelDB",
55+
"tdBag2",
56+
"VoidStorageFrame",
57+
58+
-- Function
59+
"abs",
60+
"CreateFrame",
61+
"debugstack",
62+
"EquipmentManager_UnpackLocation",
63+
"floor",
64+
"GameTooltip_Hide",
65+
"GetAddOnMetadata",
66+
"GetAverageItemLevel",
67+
"GetBuybackItemLink",
68+
"GetCurrentGuildBankTab",
69+
"GetGuildBankItemLink",
70+
"GetInboxItemLink",
71+
"GetInboxNumItems",
72+
"GetInventoryItemLink",
73+
"GetInventoryItemTexture",
74+
"GetItemInfo",
75+
"GetItemInfoInstant",
76+
"GetMerchantItemLink",
77+
"GetNumBuybackItems",
78+
"GetNumQuestChoices",
79+
"GetNumQuestLogChoices",
80+
"GetNumQuestLogRewards",
81+
"GetNumQuestRewards",
82+
"GetQuestItemLink",
83+
"GetQuestLogItemLink",
84+
"GetSendMailItemLink",
85+
"GetTradePlayerItemLink",
86+
"GetTradeTargetItemLink",
87+
"GetVoidItemInfo",
88+
"GetVoidTransferDepositInfo",
89+
"GetVoidTransferWithdrawalInfo",
90+
"gsub",
91+
"hooksecurefunc",
92+
"InterfaceOptions_AddCategory",
93+
"IsAddOnLoaded",
94+
"OpenColorPicker",
95+
"QuestInfo_GetRewardButton",
96+
"QuestInfo_ShowRewards",
97+
"strjoin",
98+
"strmatch",
99+
"tinsert",
100+
"UIDropDownMenu_AddButton",
101+
"UIDropDownMenu_CreateInfo",
102+
"UIDropDownMenu_Initialize",
103+
"UIDropDownMenu_SetText",
104+
"UIDropDownMenu_SetWidth",
105+
"UnitClass",
106+
"wipe",
107+
108+
-- Namespace
109+
"C_Container",
110+
"C_Item",
111+
"C_QuestLog",
112+
"C_ScrappingMachineUI",
113+
"C_TooltipInfo",
114+
"Enum",
115+
"ItemLocation",
116+
"Professions",
117+
"ScrollUtil",
118+
"TooltipUtil",
15119
}

.pkgmeta

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ manual-changelog:
88
markup-type: markdown
99

1010
ignore:
11-
- "*.md"
11+
- "*.md"
12+
- .luacheckrc

colors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ local DARKBLUE = {0, 0.5, 1}
1414
local PURPLE = {0.7, 0, 1}
1515
local PINK = {1, 0, 1}
1616
local WHITE = {1, 1, 1}
17-
local HEIRLOOM = {0.9, 0.8, 0.5}
17+
-- local HEIRLOOM = {0.9, 0.8, 0.5}
1818
local UnitClass = UnitClass
1919
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
2020

init.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ ns.SyLevel = {}
33
ns.Name = addon
44
ns.TrivName = "SyLevel Continued"
55
ns.Classic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
6-
ns.BCC = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC
76
ns.Retail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
87

98
function ns.SyLevel.argcheck(value, num, ...)

itemlevel.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ local SyLevel = ns.SyLevel
33

44
local tipCache, getItemInfoInstantCache, getHyperlinkCache = {}, {}, {}
55
local itemLevelPattern = gsub(ITEM_LEVEL, '%%d', '(%%d+).?%%(?(%%d*)%%)?')
6-
local bindPatterns = {
7-
[ITEM_BIND_ON_EQUIP] = 2,
8-
-- [ITEM_BIND_TO_BNETACCOUNT] = "BoA",
9-
-- [ITEM_BNETACCOUNTBOUND] = "BoA",
10-
}
116

127
local function CachedGetItemInfoInstant(hyperlink)
138
if not getItemInfoInstantCache[hyperlink] then
@@ -95,13 +90,13 @@ do
9590
elseif id then
9691
itemLoc:SetEquipmentSlot(id)
9792
end
98-
93+
9994
local guid
10095
if itemLoc:HasAnyLocation() and itemLoc:IsValid() then
10196
guid = C_Item.GetItemGUID(itemLoc)
10297
end
10398
if not guid then return end
104-
99+
105100
local hyperlink = C_Item.GetItemLink(itemLoc)
106101
if hyperlink and not IsEquipment(hyperlink) then return end
107102

pipes/bags.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local function UpdateContainer(frame)
1818
end
1919

2020
local function UpdateCombinedContainer(frame)
21-
for id, button in frame:EnumerateItems() do
21+
for _, button in frame:EnumerateItems() do
2222
local bagId = button:GetBagID()
2323
local buttonId = button:GetID()
2424
SyLevel:CallFilters("bags", button, _E and bagId, buttonId)
@@ -36,7 +36,7 @@ end
3636
local function doHook()
3737
if (not hook) then
3838
hook = function(...)
39-
if (_E) then return update(...) end
39+
if (_E) then return Update(...) end
4040
end
4141

4242
local id = 1

pipes/inspect.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pollFrame:SetScript("OnUpdate", function(self, elapsed)
1919
local unit = InspectFrame.unit
2020
if (not unit) then
2121
self:Hide()
22-
table.wipe(_MISSING)
22+
wipe(_MISSING)
2323
end
2424

2525
for i, slotName in next, _MISSING do

pipes/missionreward.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local function update(self, rewards)
66
local index = 1
77
for _, reward in pairs(rewards) do
88
local Reward = self.Rewards[index]
9-
local _, itemLink = reward.itemID and GetItemInfo(reward.itemID)
9+
local itemLink = reward.itemID and select(2, GetItemInfo(reward.itemID))
1010
SyLevel:CallFilters("missionreward", Reward.IconBorder, _E and itemLink)
1111
index = index + 1
1212
end

sylevel.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ local function ADDON_LOADED(self, event, addon)
8181
end
8282
end
8383
--self:UpdateAllPipes()
84-
elseif SyLevelDB and SyLevelDB.version ~= _VERSION then
84+
elseif SyLevelDB then
8585
updateDB(SyLevelDB)
8686
SyLevelDB.version = _VERSION
8787
SyLevel:SetColorFunc(SyLevelDB.ColorFunc)
@@ -134,7 +134,7 @@ function SyLevel:UpdateAllPipes()
134134
SyLevel:CallOptionCallbacks()
135135
for pipe, active in SyLevel.IteratePipes() do
136136
if (active) then
137-
-- SyLevel:UpdatePipe(pipe)
137+
SyLevel:UpdatePipe(pipe)
138138
end
139139
end
140140
end

ui/ilevel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function frame:CreateOptions()
6464
UpdateEditbox()
6565
end)
6666

67-
e1:SetScript("OnEnterPressed", function(self)
67+
e1:SetScript("OnEnterPressed", function()
6868
local value = tonumber(self:GetText())
6969
if not value or value < 1 then
7070
value = 1

0 commit comments

Comments
 (0)