From a0b0307a803d82b4123f4662f93db9b39ceadb8e Mon Sep 17 00:00:00 2001 From: Paul Emmerich Date: Sat, 9 Mar 2024 17:49:41 +0100 Subject: [PATCH] Move global validations from luacheck to LuaLS Still keep the workflows separate for now to not fully block deploy on errors in LuaLS --- .github/workflows/luals.yml | 9 +++-- .luacheckrc | 69 ++----------------------------------- .luarc.json | 13 +++++++ 3 files changed, 22 insertions(+), 69 deletions(-) create mode 100644 .luarc.json diff --git a/.github/workflows/luals.yml b/.github/workflows/luals.yml index 6de4e060..814cd4f6 100644 --- a/.github/workflows/luals.yml +++ b/.github/workflows/luals.yml @@ -22,6 +22,11 @@ jobs: - name: LuaLS check uses: DeadlyBossMods/LuaLS-config@main with: - luals-repo: emmericp/lua-language-server - luals-ref: 606e9cd238dbc924929d7047497de30ff44ee50c + luals-ref: 5623a84ea9a2b27dd7121f88dd995389c702eac1 luals-check-dir: ${{ github.workspace }}/workspace + - name: Send Status to Discord + uses: nebularg/actions-discord-webhook@v1 + with: + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + status: ${{ job.status }} + if: ${{ failure() }} diff --git a/.luacheckrc b/.luacheckrc index 059fbc79..0e0c4a83 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,9 +1,11 @@ +---@diagnostic disable: lowercase-global std = "lua51" max_line_length = false exclude_files = { ".luacheckrc" } ignore = { + "1..", -- Everything related to globals, the LuaLS check is better "211", -- Unused local variable "211/L", -- Unused local variable "L" "211/CL", -- Unused local variable "CL" @@ -14,70 +16,3 @@ ignore = { "43.", -- Shadowing an upvalue, an upvalue argument, an upvalue loop variable. "542", -- An empty if branch } -globals = { - -- DBM - "DBM", - "DBM_CORE_L", - "DBM_COMMON_L", - "DBT", - - -- Lua - "bit.band", - "table.wipe", - - -- Util functions - "tContains", - "tDeleteItem", - - -- WoW - "BOSS", - "COMBATLOG_OBJECT_TYPE_PLAYER", - "LOCALIZED_CLASS_NAMES_MALE", - "RAID_CLASS_COLORS", - "SCENARIO_STAGE", - "SHIELDSLOT", - "WOW_PROJECT_ID", - "WOW_PROJECT_MAINLINE", - "WOW_PROJECT_CLASSIC", - "WOW_PROJECT_BURNING_CRUSADE_CLASSIC", - "WOW_PROJECT_WRATH_CLASSIC", - - "C_GossipInfo.GetOptions", - "C_QuestLog.GetInfo", - "C_QuestLog.GetLogIndexForQuestID", - "C_QuestLog.IsComplete", - "C_UIWidgetManager.GetIconAndTextWidgetVisualizationInfo", - "CreateFrame", - "GetLocale", - "GetNumGroupMembers", - "GetNumSubgroupMembers", - "GetRaidRosterInfo", - "GetRealZoneText", - "GetServerTime", - "GetTime", - "GetQuestLogIndexByID", - "GetQuestLogTitle", - "GetGossipOptions", - "IsInGroup", - "IsInRaid", - "IsQuestComplete", - "UIDropDownMenu_AddButton", - "UIDropDownMenu_CreateInfo", - "UnitAffectingCombat", - "UnitCastingInfo", - "UnitClass", - "UnitExists", - "UnitFactionGroup", - "UnitGetTotalAbsorbs", - "UnitGUID", - "UnitHealth", - "UnitHealthMax", - "UnitIsDeadOrGhost", - "UnitIsGroupLeader", - "UnitIsUnit", - "UnitName", - "UnitDebuff", - "UnitPosition", - "UIParent", - "UnitInRaid", -} diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 00000000..02ef1230 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "runtime.version": "Lua 5.1", + "diagnostics.globals": [ + "GetGossipOptions", + "UIDropDownMenu_AddButton", + "UIDropDownMenu_CreateInfo", + "SHIELDSLOT", + "BOSS", + "UnitDebuff", + "SCENARIO_STAGE" + ] +}