-- luacheck configuration for HousingDecorGuide
-- WoW Lua 5.1 environment with addon-specific globals

std = "lua51"
max_line_length = false
codes = true

-- Globals DEFINED by this addon
globals = {
    -- Main addon
    "HousingDecorGuide",

    -- Data tables
    "HDG_DecorDB",
    "HDG_AllDecorDB",
    "HDG_VendorDB",
    "HDG_VendorByItem",
    "HDG_TrainersDB",
    "HDG_ProfessionsDB",
    "HDG_ReagentsDB",
    "HDG_ProfessionThresholds",

    -- Module tables
    "HDG_Data",
    "HDG_UI",
    "HDG_UIHelpers",
    "HDG_LumberTracker",
    "HDG_PriceIntegration",
    "HDG_PowerCrafting",
    "HDG_VendorResolver",
    "HDG_ExpansionData",

    -- Tab modules
    "HDG_DataTab",
    "HDG_AltsTab",
    "HDG_RecipesTab",
    "HDG_ConfigTab",
    "HDG_GoblinTab",
    "HDG_DecorPreview",
    "HDG_AcquisitionTab",
    "HDG_Trainers",
    "HDG_AcqData",
    "HDG_AcqRows",

    -- Localization
    "HDG_L",
    "HDG_Localization",

    -- SavedVariables
    "HDG_Settings",
    "HDG_DB",

    -- Addon compartment callbacks (TOC references)
    "HousingDecorGuide_OnAddonCompartmentClick",
    "HousingDecorGuide_OnAddonCompartmentEnter",
    "HousingDecorGuide_OnAddonCompartmentLeave",

    -- Slash commands
    "SLASH_HDG1",
    "SLASH_LUMBERHUD1",
    "SLASH_HDGDEBUG1",
    "SlashCmdList",

    -- Export utilities
    "HDG_ExportReagents",
    "HDG_ShowExportWindow",
    "HDG_ReagentExportFrame",

    -- GoblinTab global helpers
    "ShowExpansionPanel",
    "UpdateScanButton",

    -- Waypoints
    "HDG_VendorPinMixin",
}

-- Globals READ by this addon (WoW API + third-party)
read_globals = {
    -- WoW C_* namespaced APIs
    "C_AddOns",
    "C_HousingCatalog",
    "C_Housing",
    "C_Item",
    "C_Map",
    "C_MajorFactions",
    "C_Navigation",
    "C_Reputation",
    "C_SpellBook",
    "C_SuperTrack",
    "C_Timer",
    "C_Texture",
    "C_TooltipInfo",
    "C_TradeSkillUI",
    "C_CurrencyInfo",

    -- Frame creation & UI
    "CreateFrame",
    "CreateFramePool",
    "CreateFromMixins",
    "CreateUnsecuredRegionPoolInstance",
    "Mixin",
    "UIParent",
    "GameTooltip",
    "GameTooltip_Hide",
    "BackdropTemplateMixin",
    "CreateAtlasMarkup",
    "GetCursorPosition",
    "MapCanvasDataProviderMixin",
    "MapCanvasPinMixin",
    "OpenWorldMap",
    "ProfessionsFrame",
    "HideUIPanel",
    "UiMapPoint",
    "WorldMapFrame",

    -- Item/Spell APIs
    "GetItemInfo",
    "GetSpellInfo",
    "GetMerchantItemLink",
    "GetMerchantNumItems",
    "GetMerchantItemInfo",
    "GetMerchantItemID",
    "GetMerchantItemCostInfo",
    "GetMerchantItemCostItem",

    -- Player/Unit APIs
    "UnitName",
    "UnitGUID",
    "UnitExists",
    "UnitFactionGroup",
    "GetPlayerFacing",
    "InCombatLockdown",

    -- Locale/Realm
    "GetLocale",
    "GetRealmName",

    -- Time
    "GetTime",
    "GetServerTime",
    "time",
    "date",

    -- Formatting & fonts
    "BreakUpLargeNumbers",
    "STANDARD_TEXT_FONT",
    "GameFontHighlightSmall",
    "GameFontNormal",
    "GameFontNormalSmall",
    "GameFontNormalLarge",
    "SystemFont_Small",

    -- Animation
    "UIFrameFadeIn",
    "UIFrameFadeOut",

    -- WoW Lua extensions
    "wipe",
    "tinsert",
    "tremove",
    "strsplit",
    "strtrim",
    "strjoin",
    "tContains",
    "CopyTable",
    "format",

    -- WoW constants
    "Enum",
    "BACKPACK_CONTAINER",
    "NUM_BAG_SLOTS",

    -- Shared scheme constants
    "VAMOOSE_SchemeConstants",

    -- Third-party addons (optional deps)
    "TSM_API",
    "Auctionator",
    "TomTom",
    "LibStub",
}

-- Exclude data files (huge generated tables), localization, libs, and signatures
exclude_files = {
    "data/*",
    "locales/*",
    "libs/*",
    "modules/_signatures.lua",
    "utilities/*",
}

-- Allow unused self parameter (common in WoW OnClick/OnScript patterns)
self = false

-- Ignore specific warnings
ignore = {
    "211/addonName",   -- Unused 'addonName' from varargs (standard WoW pattern)
    "211/privateDB",   -- Unused 'privateDB' from varargs (standard WoW pattern)
    "212/_.*",         -- Unused variables starting with underscore
    "212/self",        -- Unused self (WoW callback pattern)
    "432/self",        -- Self-shadowing in nested methods (WoW UI pattern)
    "611",             -- Lines with only whitespace
}
