From bc5f34657a9ba81c0867356380fdd191edab4b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Wed, 20 Mar 2019 10:27:19 +0100 Subject: [PATCH] Code cleanup --- .luacheckrc | 4 ++++ .pkgmeta | 1 + ElvUI.lua | 4 ++-- LICENSE.txt | 2 +- README.md | 2 +- REFlex.lua | 3 +-- REFlexFunctions.lua | 1 - 7 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..343b0d5 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,4 @@ +globals = {'LibStub', 'UIDROPDOWNMENU_OPEN_PATCH_VERSION', 'UIDROPDOWNMENU_OPEN_MENU', 'COMMUNITY_UIDD_REFRESH_PATCH_VERSION', 'COMMUNITY_UIDD_REFRESH_PATCH_VERSION', 'RAID_CLASS_COLORS', 'LOCALIZED_CLASS_NAMES_MALE', 'CLASS_ICON_TCOORDS', 'ALL', 'ARENA_2V2', 'ARENA_3V3', 'BATTLEGROUND_10V10', 'MAX_CLASSES', 'BATTLEGROUND', 'AUCTION_DURATION', 'DAMAGE', 'WIN', 'SHOW_COMBAT_HEALING', 'HONOR', 'RATING', 'TEAM', 'ENEMY', 'ARENA', 'hooksecurefunc', 'issecurevariable', 'FriendsFrame', 'FriendsTabHeader'} +ignore = {'self', '532'} +max_line_length = false +self = false diff --git a/.pkgmeta b/.pkgmeta index 7e2f9e6..d4842cb 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -17,6 +17,7 @@ externals: ignore: - README.md + - .luacheckrc - Libs/LibToast-1.0/LibStub - Libs/LibToast-1.0/LibToast-1.0.toc - Libs/LibToast-1.0/lib.xml diff --git a/ElvUI.lua b/ElvUI.lua index 45fa9f7..3b3ba51 100644 --- a/ElvUI.lua +++ b/ElvUI.lua @@ -1,8 +1,8 @@ local _G = _G local unpack = _G.unpack -if not AddOnSkins then return end -local AS = unpack(AddOnSkins) +if not _G.AddOnSkins then return end +local AS = unpack(_G.AddOnSkins) if not AS:CheckAddOn("REFlex") then return end function AS:REFlex() diff --git a/LICENSE.txt b/LICENSE.txt index 414e47c..c6d47de 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,2 +1,2 @@ All Rights Reserved unless otherwise explicitly stated. -Copyright (c) 2013-2018 Paweł Jastrzębski +Copyright (c) 2013-2019 Paweł Jastrzębski diff --git a/README.md b/README.md index e239e3b..17c81f1 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ All Rights Reserved unless otherwise explicitly stated. -Copyright (c) 2013-2018 Paweł Jastrzębski +Copyright (c) 2013-2019 Paweł Jastrzębski diff --git a/REFlex.lua b/REFlex.lua index 013a58d..f11c74c 100644 --- a/REFlex.lua +++ b/REFlex.lua @@ -53,7 +53,6 @@ if (COMMUNITY_UIDD_REFRESH_PATCH_VERSION or 0) < 1 then end) end ---GLOBALS: UIDROPDOWNMENU_VALUE_PATCH_VERSION, UIDROPDOWNMENU_MAXLEVELS, UIDROPDOWNMENU_MAXBUTTONS, UIDROPDOWNMENU_OPEN_PATCH_VERSION, UIDROPDOWNMENU_OPEN_MENU, issecurevariable local tinsert = _G.table.insert local mfloor = _G.math.floor local strmatch = _G.string.match @@ -576,7 +575,7 @@ function RE:OnEnterTooltip(cellFrame, databaseID) RE.TooltipRGB1:SetBackdropColor(red, green, blue, ElvUI[1].Tooltip and ElvUI[1].Tooltip.db.colorAlpha or 1) end RE.TooltipRGB1:Show() - local team, damageSum, healingSum, kbSum = RE:GetRGBTeamDetails(databaseID, false) + team, damageSum, healingSum, kbSum = RE:GetRGBTeamDetails(databaseID, false) RE.TooltipRGB2 = QTIP:Acquire("REFlexTooltipRGB2", 7, "CENTER", "CENTER", "CENTER", "CENTER", "CENTER", "CENTER", "CENTER") RE.TooltipRGB2:AddLine() for i=1, 7 do diff --git a/REFlexFunctions.lua b/REFlexFunctions.lua index 01dfedd..7403494 100644 --- a/REFlexFunctions.lua +++ b/REFlexFunctions.lua @@ -6,7 +6,6 @@ local DUMP = LibStub("LibTextDump-1.0") local TOAST = LibStub("LibToast-1.0") local ST = LibStub("ScrollingTable") ---GLOBALS: CLASS_ICON_TCOORDS, RAID_CLASS_COLORS, LOCALIZED_CLASS_NAMES_MALE local tinsert, tsort, tconcat, tremove = _G.table.insert, _G.table.sort, _G.table.concat, _G.table.remove local mfloor = _G.math.floor local sgsub, sbyte = _G.string.gsub, _G.string.byte