User:Ganaram inukshuk/Provisional style guide for Lua: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
No edit summary
Line 1: Line 1:
Parts of it are adapted to follow editing on the wiki.
== Lua style ==
The following style guide is a provisional guide adapted from the LuaRocks style guide: https://github.com/luarocks/lua-style-guide
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 ===
 
== Indentation and formatting ==
Use the default as specified by the in-browser Lua editor.
Use the default as specified by the in-browser Lua editor.


== Documentation ==
=== Documentation ===
''to be determined''
''to be determined''


== Variable names ==
=== Variable names ===
Same as LuaRocks style guide.
Same as LuaRocks style guide.


== Tables ==
=== Tables ===
Same as LuaRocks style guide.
Same as LuaRocks style guide.


== Strings ==
=== Strings ===
Same as LuaRocks style guide.
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.
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 ==
=== Line lengths ===
''to be determined''
''to be determined''


== Function declaration syntax ==
=== Function declaration syntax ===
Same as LuaRocks style guide
Same as LuaRocks style guide


== Function calls ==
=== Function calls ===
Same as LuaRocks style guide.
Same as LuaRocks style guide.


=== Use of wrapper functions ===
==== Use of wrapper functions ====
Allowed.
Allowed.


== Table attributes ==
=== Table attributes ===
''to be determined''
''to be determined''


== Blocks ==
=== Blocks ===
''to be determined''
''to be determined''


== Spacing ==
=== Spacing ===
Use a space after <code>--</code>, used for comments. The lack of a space after <code>--</code> should indicate commented-out code.
Use a space after <code>--</code>, used for comments. The lack of a space after <code>--</code> should indicate commented-out code.

Revision as of 01:28, 29 November 2024

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

Lua style

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

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 --, used for comments. The lack of a space after -- should indicate commented-out code.