The sections below include the coding conventions with respect to expressions.
Do not keep spaces between the function name and opening parentheses
If it is not possible to keep the function invocation in a single line due to it exceeding the maximum line length, split it into a new line based on the best practices given in Line breaks.
- If empty, keep it as an empty block.
- In a record literal, arrange the fields in a single line. Then, add a space after the comma and leave no spaces between the braces and fields.
- Do not keep any spaces between the key and the colon. Also, keep only one space between the colon and the value.
- You can define the fields in new lines. If you do so, make sure each field is in a separate line and is block-indented.
- For map literals, follow the same formatting guidelines as Record literals.
- Always, place a tuple in a single line.
- If a tuple exceeds the maximum line length limit, move the whole tuple to a new line and indent with four spaces from the starting position of the statement or definition.
- Place simple arrays in a single line.
- Do not keep any spaces between the opening bracket, value, and the closing bracket.
- If an array cannot be placed on a single line due to it exceeding the maximum line length, split each value in the array to its own block-indented line.
- Do not keep spaces between the type and the angle brackets (i.e.,
- Do not keep spaces between the closing angle bracket and value reference, which will be casted.
- Avoid line breaks in type casting.
- Follow the formatting guidelines of Record literals when formatting a table block.