LuaFormatter icon indicating copy to clipboard operation
LuaFormatter copied to clipboard

Feature Request (if not already present) - Add option to end all lines with semi-colon `;`

Open Mayron opened this issue 3 years ago • 0 comments

I'm used to programming in other languages like C# where you end each line with a semi-colon ; and I'd rather keep this style preference in my Lua code. Can I enforce this with a style config option?

For example, if any statement is missing the ; then they should be added with this requested rule enabled:

function verify(expected, actual)
  assert(actual == expected)
  return true
end

local a = "hello" local b = ", world"
local result = a .. b

if verify("hello, world", result) then
  local payload = { success = true }
  -- sendRequest(payload)
end

Should become:

function verify(expected, actual)
  assert(actual == expected);
  return true;
end

local a = "hello"; local b = ", world";
local result = a .. b;

if verify("hello, world", result) then
  local payload = { success = true };
  -- sendRequest(payload)
end

Mayron avatar Sep 17 '22 09:09 Mayron