description: "Use when writing or editing Lua scripts (.lua files). V-Gears Lua style: indentation, naming, locals, end terminators, doxygen comments."
Full guide: doc/STYLE-LUA.md.
snake_case (front_color); larger scope → more descriptive names.PascalCase. Constants: ALL_CAPS. Module names: all lowercase.local for variables and functions; avoid globals.end; on long blocks, annotate the closing end with a comment (end -- if).-- in comments.Document every block of code with doxygen-style docstrings:
--[[
Retrieves a bit variable.
@param bank Memory bank (0-index, as in game).
@return 1 or 0
]]
Test for non-nil idiomatically: if line then, not if line ~= nil then.
Note: Lua generated by the installer's script decompiler follows these rules on a best-effort basis — do not hand-reformat large generated files.