mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-07 02:12:07 +03:00
Tweak GDScript and C# Style guides
Rename code structure -> formatting Add a heading Encoding and special characters for the corresponding section Add missing Indentation heading that was gone
This commit is contained in:
@@ -27,8 +27,11 @@ later.
|
||||
For detailed information on C# features in different versions, please see
|
||||
`What's New in C# <https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/>`_.
|
||||
|
||||
Formatting conventions
|
||||
----------------------
|
||||
Formatting
|
||||
----------
|
||||
|
||||
General guidelines
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* 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.
|
||||
@@ -36,8 +39,6 @@ Formatting conventions
|
||||
* 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
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -136,6 +137,7 @@ Avoid inserting a blank line:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Using spaces
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -18,18 +18,21 @@ styleguide.
|
||||
.. note:: Godot's built-in script editor uses a lot of these conventions
|
||||
by default. Let it help you.
|
||||
|
||||
Formatting conventions
|
||||
----------------------
|
||||
Formatting
|
||||
----------
|
||||
|
||||
Encoding and special characters
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Use line feed (**LF**) characters to break lines, not CRLF or CR. *(editor default)*
|
||||
* Use one line feed character at the end of each file. *(editor default)*
|
||||
* Use **UTF-8** encoding without a `byte order mark <https://en.wikipedia.org/wiki/Byte_order_mark>`_. *(editor default)*
|
||||
* Use **Tabs** instead of spaces for indentation. *(editor default)*
|
||||
|
||||
Each indent level should be one greater than the block containing it.
|
||||
Indentation
|
||||
~~~~~~~~~~~
|
||||
|
||||
Code structure
|
||||
--------------
|
||||
Each indent level should be one greater than the block containing it.
|
||||
|
||||
**Good**:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user