Skip to content

Commit

Permalink
Move global validations from luacheck to LuaLS
Browse files Browse the repository at this point in the history
Still keep the workflows separate for now to not fully block deploy on
errors in LuaLS
  • Loading branch information
emmericp committed Mar 9, 2024
1 parent f55b1a3 commit 2a8db0b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 69 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/luals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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() }}
69 changes: 2 additions & 67 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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",
}
13 changes: 13 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -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"
]
}

0 comments on commit 2a8db0b

Please sign in to comment.