Make the source pass the CI lint
ci/woodpecker/push/tic80 Pipeline was successful
ci/woodpecker/manual/tic80 Pipeline was successful

The central pipeline lints where the old inline one did not, and it
aborts on any warning. Nothing here was actually wrong: 166 of the 243
warnings were the TIC-80 API and the game's own globals being undeclared,
which is what .luacheckrc is for — the same shape impostor already uses.

The rest was trailing whitespace on 14 lines, now stripped. INPUT_KEY_X
is unused but kept: it belongs to the LEFT/RIGHT/A/B/X/Y set and removing
it would leave a gap in the mapping, so luacheck is told to allow the
family.

Verified locally by merging the sources the way the pipeline does and
running luacheck over the result: 0 warnings, 0 errors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-16 22:49:06 +02:00
co-authored by Claude Opus 5
parent 436c7f500c
commit d45143d69d
7 changed files with 44 additions and 14 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ function init_game()
end
function TIC()
init_game()
init_game()
cls(Config.colors.black)
local handler = STATE_HANDLERS[Context.active_window]
+4 -4
View File
@@ -35,7 +35,7 @@ end
function UI.word_wrap(text, max_chars_per_line)
if text == nil then return {""} end
local lines = {}
for input_line in (text .. "\n"):gmatch("(.-)\n") do
local current_line = ""
local words_in_line = 0
@@ -50,18 +50,18 @@ function UI.word_wrap(text, max_chars_per_line)
current_line = word
end
end
if words_in_line > 0 then
table.insert(lines, current_line)
else
table.insert(lines, "")
end
end
if #lines == 0 then
return {""}
end
return lines
end
+4 -4
View File
@@ -39,15 +39,15 @@ function ConfigurationWindow.draw()
for i, control in ipairs(ConfigurationWindow.controls) do
local current_y = y_start + (i - 1) * 12
local color = Config.colors.green
if control.type == "numeric_stepper" then
local value = control.get()
local label_text = control.label
local value_text = string.format(control.format, value)
-- Calculate x position for right-aligned value
local value_x = x_value_right_align - (#value_text * char_width)
if i == ConfigurationWindow.selected_control then
color = Config.colors.item
Print.text("<", x_start -8, current_y, color)
@@ -70,7 +70,7 @@ function ConfigurationWindow.draw()
end
end
end
Print.text("Press B to go back", x_start, 120, Config.colors.light_grey)
end
+2 -2
View File
@@ -1,9 +1,9 @@
function IntroWindow.draw()
function IntroWindow.draw()
local x = (Config.screen.width - 132) / 2 -- Centered text
Print.text(Context.intro.text, x, Context.intro.y, Config.colors.green)
end
function IntroWindow.update()
function IntroWindow.update()
Context.intro.y = Context.intro.y - Context.intro.speed
-- Count lines in intro text to determine when scrolling is done
+1 -1
View File
@@ -53,7 +53,7 @@ function MenuWindow.refresh_menu_items()
table.insert(Context.menu_items, {label = "Load Game", action = MenuWindow.load_game})
table.insert(Context.menu_items, {label = "Configuration", action = MenuWindow.configuration})
table.insert(Context.menu_items, {label = "Exit", action = MenuWindow.exit})
Context.selected_menu_item = 1 -- Reset selection after refreshing
end
+2 -2
View File
@@ -52,7 +52,7 @@ function PopupWindow.update()
selected_item.action()
end
end
if Input.menu_back() then
GameWindow.set_state(WINDOW_GAME)
end
@@ -92,7 +92,7 @@ function PopupWindow.draw()
Print.text(line, 50, current_y, Config.colors.light_grey)
current_y = current_y + 8 -- Move to the next line (8 pixels for default font height + padding)
end
-- Adjust menu position based on the number of wrapped lines
if not Context.dialog.showing_description then
UI.draw_menu(Context.dialog.menu_items, Context.dialog.selected_menu_item, 50, current_y + 2)