Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.6.0 #99

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ externals:
Libs/AceHook-3.0: https://repos.wowace.com/wow/ace3/trunk/AceHook-3.0
Libs/AceTimer-3.0: https://repos.wowace.com/wow/ace3/trunk/AceTimer-3.0
Libs/AceLocale-3.0: https://repos.wowace.com/wow/ace3/trunk/AceLocale-3.0
Libs/AceBucket-3.0: https://repos.wowace.com/wow/ace3/trunk/AceBucket-3.0

enable-nolib-creation: yes

Expand Down
17 changes: 15 additions & 2 deletions .scripts/hardcode_string_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Function to check if a file or directory should be ignored
def should_ignore(path, ignore_files, ignore_dirs):
if os.path.basename(path) in ignore_dirs:
return True
for dir in ignore_dirs:
if path.startswith(f"./{dir}/"):
return True
Expand Down Expand Up @@ -65,8 +67,19 @@ def scan_directory(directory, ignore_files=None, ignore_dirs=None):


def main():
ignore_files = ["TestMode.lua"]
ignore_dirs = [".git", ".scripts", ".release", "locale"]
ignore_files = []
ignore_dirs = [
".git",
".github",
".release",
".scripts",
".trunk",
".venv",
"Icons",
"locale",
"luacov-html",
"spec",
]

# Scan the current directory
issues = scan_directory(".", ignore_files, ignore_dirs)
Expand Down
3 changes: 3 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ lint:
- linters: [stylua]
paths:
- locale/**
- linters: [no-invalid-prints]
paths:
- spec/**
enabled:
- [email protected]
- [email protected]
Expand Down
60 changes: 44 additions & 16 deletions AddonScope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,52 @@ G_RLF = {}
local addonName = "RPGLootFeed"
local dbName = addonName .. "DB"
local localeName = addonName .. "Locale"

local xpcall = xpcall

local function errorhandler(err)
local suffix = "\n\n==== Addon Info " .. G_RLF.addonName .. " " .. G_RLF.addonVersion .. " ====\n\n"
suffix = suffix .. G_RLF.L["Issues"] .. "\n\n"

return geterrorhandler()(err .. suffix)
end

function G_RLF:fn(func, ...)
-- Borrowed from AceAddon-3.0
if type(func) == "function" then
return xpcall(func, errorhandler, ...)
end
end

G_RLF.RLF = LibStub("AceAddon-3.0"):NewAddon(addonName, "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0")
G_RLF.RLF:SetDefaultModuleState(true)
G_RLF.RLF:SetDefaultModulePrototype({
getLogger = function(self)
return G_RLF.RLF:GetModule("Logger")
end,
fn = function(s, func, ...)
local function errorhandler(err)
local suffix = "\n\n==== Addon Info " .. G_RLF.addonName .. " " .. G_RLF.addonVersion .. " ====\n\n"
local status, trace = pcall(function()
return s:getLogger():Trace(s.moduleName)
end)
if status then
suffix = suffix .. "Log traces related to " .. s.moduleName .. "\n"
suffix = suffix .. "-------------------------------------------------\n"
suffix = suffix .. trace
suffix = suffix .. "-------------------------------------------------\n\n"
end
suffix = suffix .. G_RLF.L["Issues"] .. "\n\n"

return geterrorhandler()(err .. suffix)
end

-- Borrowed from AceAddon-3.0
if type(func) == "function" then
return xpcall(func, errorhandler, ...)
end
end,
})
G_RLF.addonName = addonName
G_RLF.dbName = dbName
G_RLF.localeName = localeName
Expand All @@ -20,19 +64,3 @@ G_RLF.DisableBossBanner = {
function G_RLF:Print(...)
G_RLF.RLF:Print(...)
end

local xpcall = xpcall

local function errorhandler(err)
local suffix = "\n\n==== Addon Info " .. G_RLF.addonName .. " " .. G_RLF.addonVersion .. " ====\n\n"
suffix = suffix .. G_RLF.L["Issues"] .. "\n\n"

return geterrorhandler()(err .. suffix)
end

function G_RLF:fn(func, ...)
-- Borrowed from AceAddon-3.0
if type(func) == "function" then
return xpcall(func, errorhandler, ...)
end
end
Loading
Loading