Help:Extensions/Scribunto/Style Guide

Indentation
Use 2 spaces per indentation level.

Continuing lines should be aligned vertically.

Good:

Bad:

White space
Use white space generously in your code.

Use 2 blank lines to separate functions from the package table/imports. Use single blank lines to separate individual functions.

Imports
Requirements should always be at the top of a script and ordered alphabetically, to make them immediately obvious.

List extensions (e.g. ) before required modules.