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

Move global validations from luacheck to LuaLS #96

Merged
merged 1 commit into from
Mar 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
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"
]
}