From d7af8707026968887ea4ee3a4e6fa51fd4372033 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Thu, 24 Sep 2026 13:30:07 +0100 Subject: fix(lua): enable nil-safety diagnostics in runtime code Enable EmmyLua's need-check-nil diagnostic and resolve nullable values through more precise types, explicit invariants, and guards for missing runtime state. Keep analyzer-specific workarounds local and update the affected API documentation. Exclude the bundled re.lua from analysis so its nil-check warnings do not fail CI. AI-assisted --- runtime/lua/vim/log.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/log.lua') diff --git a/runtime/lua/vim/log.lua b/runtime/lua/vim/log.lua index 84fcdd0713..c9e00d32b5 100644 --- a/runtime/lua/vim/log.lua +++ b/runtime/lua/vim/log.lua @@ -104,8 +104,8 @@ local function default_format_func(min_level, level, ...) '[%s][%s] %s:%s', level_names[level], os.date(log_date_format), - info.short_src, - info.currentline + info and info.short_src or '?', + info and info.currentline or -1 ) local parts = { header } local argc = select('#', ...) -- cgit