Add file formatting to GDScript style guide

Recommend LF, newline at end of file, UTF-8, no BOM, and tabs. The displayed size of tabs does not matter as it does not affect the saved files, so don't mention it. Also slightly change the C# style guide for consistency.
This commit is contained in:
Aaron Franke
2020-01-02 17:20:33 -05:00
parent cba5770d19
commit 766e4687e5
2 changed files with 15 additions and 10 deletions

View File

@@ -31,12 +31,16 @@ Formatting conventions
----------------------
* Use line feed (**LF**) characters to break lines, not CRLF or CR.
* Use one line feed character at the end of each file, except for `csproj` files.
* Use **UTF-8** encoding without a `byte order mark <https://en.wikipedia.org/wiki/Byte_order_mark>`_.
* Use **4 spaces** instead of tabs for indentation (which is referred to as "soft tabs").
* Consider breaking a line into several if it's longer than 100 characters.
Code structure
--------------
Line breaks and blank lines
---------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~
For a general indentation rule, follow `the "Allman Style" <https://en.wikipedia.org/wiki/Indentation_style#Allman_style>`_
which recommends placing the brace associated with a control statement on the next line, indented to
@@ -133,7 +137,7 @@ Avoid inserting a blank line:
}
Using spaces
------------
~~~~~~~~~~~~
Insert a space: