User:Ganaram inukshuk/Provisional style guide for Lua

Revision as of 23:30, 19 November 2024 by Ganaram inukshuk (talk | contribs) (Created page with "The following style guide is a provisional guide adapted from the LuaRocks style guide: https://github.com/luarocks/lua-style-guide Parts of it are adapted to follow editing...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The following style guide is a provisional guide adapted from the LuaRocks style guide: https://github.com/luarocks/lua-style-guide

Parts of it are adapted to follow editing on the wiki.

Indentation and formatting

Use the default as specified by the in-browser Lua editor.

Documentation

to be determined

Variable names

Same as LuaRocks style guide.

Tables

Same as LuaRocks style guide.

Strings

Same as LuaRocks style guide.

Do not escape double-quotes when a string can be enclosed in single-quotes instead. Only escape double-quotes when a string contains both single and double quotes.

Line lengths

to be determined

Function declaration syntax

Same as LuaRocks style guide

Function calls

Same as LuaRocks style guide.

Use of wrapper functions

Allowed.

Table attributes

to be determined

Blocks

to be determined

Spacing

Use a space after <code>--</code>. The lack of a space after <code>--</code> should indicate commented-out code.