mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Defer need-check-nil and clean up stale suppressions
emmylua deserialises an unknown diagnostic code to a catch all that matches no checker, so every `invisible`, `nil-check` and `global-element` suppression was silently doing nothing. Renamed to the emmylua codes. `name-style-check` has no equivalent and is dropped, it was already disabled under luals. The `get_tile` suppressions referenced an api typedef bug from 2024 which no longer reproduces. need-check-nil is deferred rather than disabled on merit: a third of the 407 findings come from MapPosition and BoundingBox being aliased as `struct|[double, double]`, so every `entity.position.x` reads as possibly nil. The rest need per site knowledge of runtime invariants. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,6 @@ end
|
||||
--- @param surface LuaSurface
|
||||
--- @param position MapPosition
|
||||
local function degrade_tile(surface, position)
|
||||
--- @diagnostic disable-next-line Incorrect Api Type: https://forums.factorio.com/viewtopic.php?f=233&t=109145&p=593761&hilit=get_tile#p593761
|
||||
local tile = surface.get_tile(position)
|
||||
local tile_name = tile.name
|
||||
local degrade_tile_name = config.degrade_order[tile_name]
|
||||
@@ -61,7 +60,6 @@ end
|
||||
--- @param position MapPosition
|
||||
--- @return number?
|
||||
local function get_tile_strength(surface, position)
|
||||
--- @diagnostic disable-next-line Incorrect Api Type: https://forums.factorio.com/viewtopic.php?f=233&t=109145&p=593761&hilit=get_tile#p593761
|
||||
local tile = surface.get_tile(position)
|
||||
local tile_name = tile.name
|
||||
local strength = config.strengths[tile_name]
|
||||
|
||||
@@ -164,7 +164,6 @@ local function clear_spawn_area(surface, offset)
|
||||
local get_tile = surface.get_tile
|
||||
|
||||
-- Make sure a non water tile is used for filling
|
||||
--- @diagnostic disable-next-line Incorrect Api Type: https://forums.factorio.com/viewtopic.php?f=233&t=109145&p=593761&hilit=get_tile#p593761
|
||||
local starting_tile = get_tile(offset)
|
||||
local fill_tile = starting_tile.collides_with("player") and "landfill" or starting_tile.name
|
||||
local fill_radius = config.spawn_area.landfill_radius
|
||||
@@ -185,7 +184,6 @@ local function clear_spawn_area(surface, offset)
|
||||
if dst < tile_radius_sqr then
|
||||
-- If it is inside the decon radius always set the tile
|
||||
tiles_to_make[#tiles_to_make + 1] = { name = decon_tile, position = pos }
|
||||
--- @diagnostic disable-next-line Incorrect Api Type: https://forums.factorio.com/viewtopic.php?f=233&t=109145&p=593761&hilit=get_tile#p593761
|
||||
elseif dst < fill_radius_sqr and get_tile(pos).collides_with("player") then
|
||||
-- If it is inside the fill radius only set the tile if it is water
|
||||
tiles_to_make[#tiles_to_make + 1] = { name = fill_tile, position = pos }
|
||||
|
||||
Reference in New Issue
Block a user