Use new linter (#294)

* Use new linter

* Luacheck and Sumneko Lua fixes

* Bump CI action versions

* Fix excludes for ldoc
This commit is contained in:
Cooldude2606
2024-05-29 15:39:37 +01:00
committed by GitHub
parent 4fa410e872
commit 8638504550
27 changed files with 96 additions and 92 deletions

View File

@@ -6,7 +6,7 @@ local type = type
local concat = table.concat
local inspect = table.inspect
local pcall = pcall
local loadstring = loadstring
local loadstring = loadstring ---@diagnostic disable-line
local rawset = rawset
local Public = {}

View File

@@ -32,7 +32,8 @@ local function format_energy(amount, unit)
end
end
local formatted, k = amount
local k
local formatted = amount
while true do
formatted, k = string.gsub(formatted, '^(-?%d+)(%d%d%d)', '%1,%2')

View File

@@ -806,6 +806,7 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function()
if was_in_range and not in_range then
PlayerInRange:set(player, nil)
elseif not was_in_range and in_range then
---@cast closest_warp -nil
PlayerInRange:set(player, closest_warp.warp_id)
end
@@ -819,6 +820,7 @@ Event.on_nth_tick(math.floor(60/config.update_smoothing), function()
add_warp_element.enabled = true
add_warp_element.tooltip = {'warp-list.add-tooltip'}
elseif not can_make_warp and was_able_to_make_warp or closest_warp and (old_closest_warp_name ~= closest_warp.name) then
---@cast closest_warp -nil
add_warp_element.enabled = false
add_warp_element.tooltip = {'warp-list.too-close', closest_warp.name}
end