From 411ca55f234cab5f524a0a8083d08c24159e20f8 Mon Sep 17 00:00:00 2001 From: funkydude Date: Mon, 3 May 2021 16:54:08 +0100 Subject: [PATCH] Address Luacheck issues --- .luacheckrc | 13 ++++++++++++- BadBoy.lua | 4 ++-- Generate.lua | 4 ++-- Locale.lua | 2 +- SimpleOptions.lua | 6 +++--- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index ce82208..98a71e6 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -5,12 +5,23 @@ exclude_files = { "**/Libs", } ignore = { - + "111/SLASH_BADBOY1", -- slash handlers + "112/SlashCmdList", } globals = { "BADBOY_OPTIONS", "BADBOY_BLACKLIST", + "C_Map", "date", "GetFramesRegisteredForEvent", + "GetLocale", "SetCVar", + + -- Options + "ADDON_MISSING", + "CreateFrame", + "GameTooltip", + "GameTooltip_Hide", + "PlaySound", + "UIParent", } diff --git a/BadBoy.lua b/BadBoy.lua index 36a5b91..bfdc275 100644 --- a/BadBoy.lua +++ b/BadBoy.lua @@ -19,7 +19,7 @@ local repTbl = { ["Ą"]="a", ["ą"]="a", ["Ā"]="a", ["ā"]="a", ["Ă"]="a", ["ă"]="a", -- Convert > \97. Note: Ą, Ā, Ă fail with strlower, include both. ["с"]="c", ["ç"]="c", ["Ć"]="c", ["ć"]="c", ["Č"]="c", ["č"]="c", ["Ĉ"]="c", ["ĉ"]="c", ["Ċ"]="c", ["ċ"]="c", --First letter is Russian "\209\129". Convert > \99. Note: Ć, Č, Ĉ, Ċ fail with strlower, include both. ["Ď"]="d", ["ď"]="d", ["Đ"]="d", ["đ"]="d", --Convert > \100. Note: Ď, Đ fail with strlower, include both. - ["е"]="e", ["è"]="e", ["é"]="e", ["ë"]="e", ["ё"]="e", ["ê"]="e", --First letter is Russian "\208\181". Convert > \101. + ["е"]="e", ["è"]="e", ["é"]="e", ["ë"]="e", ["ё"]="e", ["ê"]="e", --First letter is Russian "\208\181". Convert > \101. ["Ę"]="e", ["ę"]="e", ["Ė"]="e", ["ė"]="e", ["Ě"]="e", ["ě"]="e", ["Ē"]="e", ["ē"]="e", ["Έ"]="e", ["έ"]="e", ["Ĕ"]="e", ["ĕ"]="e", ["Ε"]="e", ["ε"]="e", --Note: Ę, Ė, Ě, Ē, Έ, Ĕ, Ε fail with strlower, include both. ["Ğ"]="g", ["ğ"]="g", ["Ĝ"]="g", ["ĝ"]="g", ["Ģ"]="g", ["ģ"]="g", ["Ġ"]="g", ["ġ"]="g", -- Convert > \103. Note: Ğ, Ĝ, Ģ, Ġ fail with strlower, include both. ["Ĥ"]="h", ["ĥ"]="h", -- Convert > \104. Note: Ĥ fail with strlower, include both. @@ -30,7 +30,7 @@ local repTbl = { ["к"]="k", ["Ķ"]="k", ["ķ"]="k", -- First letter is Russian "\208\186". Convert > \107. -- Note: Ķ fail with strlower, include both. ["Ł"]="l", ["ł"]="l", ["Ĺ"]="l", ["ĺ"]="l", ["Ľ"]="l", ["ľ"]="l", -- Convert > \107. -- Note: Ł, Ĺ, Ľ fail with strlower, include both. ["Μ"]="m", ["м"]="m", -- First letter is capital Greek μ "\206\156". Convert > \109 - ["η"]="n", ["ή"]="n", ["ñ"]="n", ["Ν"]="n", -- First letter is small Greek eta η "\206\183". Convert > \110. + ["η"]="n", ["ή"]="n", ["ñ"]="n", ["Ν"]="n", -- First letter is small Greek eta η "\206\183". Convert > \110. ["Ń"]="n", ["ń"]="n", ["Ņ"]="n", ["ņ"]="n", ["Ň"]="n", ["ň"]="n", ["Ŋ"]="n", ["ŋ"]="n", --Convert > \110. Note: Ń, Ņ, Ň, Ŋ fail with strlower, include both. ["о"]="o", ["ò"]="o", ["ó"]="o", ["ö"]="o", ["ô"]="o", ["õ"]="o", ["ø"]="o", ["σ"]="o", --First letter is Russian "\208\190". Convert > \111. ["Ō"]="o", ["ō"]="o", ["Ǿ"]="o", ["ǿ"]="o", ["Ő"]="o", ["ő"]="o", ["Θ"]="o", ["θ"]="o", ["Ŏ"]="o", ["ŏ"]="o", ["O"]="o", ["o"]="o", --Note: Ō, Ǿ, Ő, Θ, Ŏ, O fail with strlower, include both. diff --git a/Generate.lua b/Generate.lua index dd6cb6b..9e546fc 100644 --- a/Generate.lua +++ b/Generate.lua @@ -11,8 +11,8 @@ t.gnt = function(u, ...) for l = 1, select("#", strsplit("^", entry)) do local db = select(l, strsplit("^", entry)) for j = 1, select("#", strsplit(",", db)) do - local t = select(j, strsplit(",", db)) - local rn = tonumber(t) + local tm = select(j, strsplit(",", db)) + local rn = tonumber(tm) rn = rn - i - n if j == 1 then if pos > 0 then diff --git a/Locale.lua b/Locale.lua index 4e66d69..dfab64e 100644 --- a/Locale.lua +++ b/Locale.lua @@ -52,7 +52,7 @@ elseif loc == "ruRU" then --L.frequentButton = "Show the button more frequently" --L.frequentButtonTip = "To reduce player annoyance the report button will not always show.\nEnable this to always show the button asking to report and show it faster." elseif loc == "koKR" then - --L.spamBlocked = "BadBoy: Spam blocked" + L.spamBlocked = "BadBoy: 스팸 차단" --L.spamTooltip = "Show spam in button tooltip" --L.noAnimate = "Disable button pulse animation" --L.clickToReport = "|cffeda55fClick|r to report, |cffeda55fAlt-Click|r to dismiss." diff --git a/SimpleOptions.lua b/SimpleOptions.lua index 871c23d..0cae2b8 100644 --- a/SimpleOptions.lua +++ b/SimpleOptions.lua @@ -104,9 +104,9 @@ guildedTitle:SetPoint("TOPLEFT", btnFreqButton, "BOTTOMLEFT", 0, -88) guildedTitle:SetText("BadBoy_Guilded ["..ADDON_MISSING.."]") --[[ BadBoy_Ignore Title ]]-- -local guildedTitle = badboy:CreateFontString("BadBoyIgnoreConfigTitle", nil, "GameFontNormalLarge") -guildedTitle:SetPoint("TOPLEFT", btnFreqButton, "BOTTOMLEFT", 0, -156) -guildedTitle:SetText("BadBoy_Ignore ["..ADDON_MISSING.."]") +local ignoreTitle = badboy:CreateFontString("BadBoyIgnoreConfigTitle", nil, "GameFontNormalLarge") +ignoreTitle:SetPoint("TOPLEFT", btnFreqButton, "BOTTOMLEFT", 0, -156) +ignoreTitle:SetText("BadBoy_Ignore ["..ADDON_MISSING.."]") --[[ BadBoy_CCleaner Title ]]-- local ccleanerTitle = badboy:CreateFontString("BadBoyCCleanerConfigTitle", nil, "GameFontNormalLarge")