User:Ganaram inukshuk/Provisional style guide for Lua: Difference between revisions
No edit summary |
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 | ||
=== 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. |