Skip to content

Commit

Permalink
style: fix lua linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbrgn committed Dec 16, 2023
1 parent e4040af commit 226a797
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 2 deletions.
184 changes: 184 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
std = "lua51"
max_line_length = false
codes = true
ignore = {
"212/self",
"1/[A-Z][A-Z][A-Z0-9_]+", -- three letter+ constants
"2",
"4",
}
not_globals = {
"arg", -- arg is a standard global, so without this it won't error when we typo "args" in a module
}
globals = {
-- wow std api
"abs",
"bit",
"ceil",
"cos",
"date",
"debugstack",
"deg",
"exp",
"floor",
"format",
"frexp",
"getn",
"gmatch",
"gsub",
"hooksecurefunc",
"ldexp",
"max",
"min",
"mod",
"rad",
"random",
"scrub",
"sin",
"sort",
"sqrt",
"strbyte",
"strchar",
"strcmputf8i",
"strconcat",
"strfind",
"string.join",
"strjoin",
"strlen",
"strlenutf8",
"strlower",
"strmatch",
"strrep",
"strrev",
"strsplit",
"strsub",
"strtrim",
"strupper",
"table.wipe",
"tan",
"time",
"tinsert",
"tremove",

-- framexml
"tContains",
"tDeleteItem",

-- everything else
"AHB",
"C_EncounterJournal",
"C_GossipInfo",
"C_Minimap", -- Legion/TombOfSargeras/Kiljaeden.lua
"C_ModifiedInstance", -- 3x Affixes.lua in BigWigs_Shadowlands
"C_RaidLocks",
"C_Scenario",
"C_Timer",
"ChatFrame_ImportListToHash",
"ChatTypeInfo",
"CheckInteractDistance",
"CinematicFrame_CancelCinematic",
"CombatLogGetCurrentEventInfo",
"CombatLog_String_GetIcon",
"CreateFrame",
"EJ_GetCreatureInfo",
"EJ_GetEncounterInfo",
"ElvUI",
"FlashClientIcon",
"GameFontHighlight",
"GameFontNormal",
"GameTooltip",
"GameTooltip_Hide",
"GetAddOnDependencies",
"GetAddOnOptionalDependencies",
"GetBuildInfo",
"GetDifficultyInfo",
"GetFramesRegisteredForEvent",
"GetInstanceInfo",
"GetItemCount",
"GetLocale",
"GetNumAddOns",
"GetNumGroupMembers",
"GetPartyAssignment",
"GetPlayerFacing",
"GetProfessionInfo",
"GetProfessions",
"GetRaidRosterInfo", -- Classic/AQ40/Cthun.lua
"GetRaidTargetIndex",
"GetRealmName",
"GetRealZoneText",
"GetSpecializationInfoByID",
"GetSpellCooldown",
"GetSpellDescription",
"GetSpellInfo",
"GetSpellLink",
"GetSpellTexture",
"GetSubZoneText",
"GetTime",
"InCombatLockdown",
"IsAddOnLoaded",
"IsAddOnLoadOnDemand",
"IsAltKeyDown",
"IsControlKeyDown",
"IsEncounterInProgress",
"IsGuildMember",
"IsInGroup",
"IsInRaid",
"IsItemInRange",
"IsLoggedIn",
"IsPartyLFG",
"IsPlayerSpell",
"IsSpellKnown",
"LFGDungeonReadyPopup",
"LibStub",
"LoadAddOn",
"LoggingCombat",
"MovieFrame",
"ObjectiveTrackerFrame",
"PlayerHasToy",
"PlaySound",
"PlaySoundFile",
"RaidBossEmoteFrame",
"RaidNotice_AddMessage",
"RaidWarningFrame",
"SecondsToTime",
"StopSound",
"TalkingHeadFrame",
"Tukui",
"UIErrorsFrame",
"UIParent",
"UIWidgetManager",
"UnitAffectingCombat",
"UnitAura",
"UnitCanAttack",
"UnitCastingInfo",
"UnitClass",
"UnitExists",
"UnitFactionGroup",
"UnitGetTotalAbsorbs",
"UnitHealth",
"UnitHealthMax",
"UnitInParty",
"UnitInRaid",
"UnitInVehicle",
"UnitIsConnected",
"UnitIsCorpse",
"UnitIsDead",
"UnitIsDeadOrGhost",
"UnitIsEnemy", -- Multiple old modules
"UnitIsFriend", -- MoP/SiegeOfOrgrimmar/TheFallenProtectors.lua
"UnitIsGroupAssistant",
"UnitIsGroupLeader",
"UnitIsPlayer",
"UnitIsUnit",
"UnitLevel",
"UnitPhaseReason",
"UnitPlayerControlled",
"UnitPosition",
"UnitPower",
"UnitPowerMax",
"UnitPowerType", -- Multiple old modules
"UnitRace",
"UnitSex",
"UnitThreatSituation", -- Cataclysm/Bastion/Sinestra.lua
"Minimap", -- Legion/TombOfSargeras/Kiljaeden.lua
}
4 changes: 2 additions & 2 deletions AutoHideBinds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local AHBFrame = CreateFrame("Frame", nil, UIParent)

function AHB:HookBinds()
local ef = function() end
for n, bar in ipairs({ "Action", "MultiBarBottomLeft", "MultiBarBottomRight", "MultiBarRight", "MultiBarLeft",
for _, bar in ipairs({ "Action", "MultiBarBottomLeft", "MultiBarBottomRight", "MultiBarRight", "MultiBarLeft",
"MultiBar5", "MultiBar6", "MultiBar7" }) do
for btnnum = 1, 12 do
local btn = bar .. "Button" .. btnnum
Expand Down Expand Up @@ -61,7 +61,7 @@ function AHB:AdjustTextSize(frame)
end

AHBFrame:RegisterEvent("ADDON_LOADED")
AHBFrame:SetScript("OnEvent", function(self, event, ...)
AHBFrame:SetScript("OnEvent", function(_, event, ...)
local name = ...
if event == "ADDON_LOADED" and name == "AutoHideBinds" then
AHB:HookBinds()
Expand Down

0 comments on commit 226a797

Please sign in to comment.