38 Commits

Author SHA1 Message Date
zacryol
99e882fa28 Show example of casting get_node() for inferred static typing in style guide 2021-11-03 16:15:18 +01:00
zacryol
16a4217e11 Rename var "character_dir" to "character_dict" in GDScript style guide (#5325) 2021-10-16 01:12:27 +02:00
Hugo Locurcio
83a9c5e254 Add a GDScript style guide recommendation for multiline wrapping 2021-10-15 15:07:36 +02:00
Vladislav Vorobev
594b086995 Fixed class_name keyword ordering in GDScript style guide 2021-07-12 23:04:27 +02:00
Evgeniy Vasilyev
af4d5675e2 Fix code formatting in GDScript style guide (#4755) 2021-03-15 14:11:08 +01:00
Rémi Verschelde
08fcc85422 Fix title case 2020-09-11 09:13:16 +02:00
Nathan Leiby
97384fd5ee styleguide: clarify "static typing" syntax (#3687)
* styleguide: clarify "static typing" syntax

I first explored making an update here because I felt the current docs were confusing:

1. I could not tell if everything below "bad" was actually bad... It seemed like some of it was "good".
2. The examples involving ` var health := 0  # The compiler will use the int type.` seemed redundant, and re: (1) it was confusing to see one in "good" and one in "bad".

Do you agree whether a change is merited or did I misunderstand the docs as written?

---

While writing this proposed update, I realize that my explanation is less focused on style, but instead also explaining how declared and inferred types work. Is that what we expect in the style guide, or is the intent to be laser-focused it on syntax and code clarity? If so, perhaps we should avoid explanation and use the linked static typing guide as the source of truth for a rich explanation: https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/static_typing.html#doc-gdscript-static-typing).

Thanks for the awesome game engine!

* clarify why it doesn't work in the get_node() case
2020-09-09 19:05:35 -06:00
Hugo Locurcio
f0d0ef0ce3 Add recommendations for numbers in the GDScript style guide 2020-08-19 14:04:25 +02:00
Leonardo Jeanteur
428106f910 Correct grammar, formatting and add download link (#3860)
Add a link to Godot Engine's download page.
2020-08-02 22:02:32 +02:00
Brandon Lamb
734c65b470 Clarify example code for signal
Section discussing placing signals above other properties did not actually contain a line for signals (which confused me). Clarifying the style guide by showing a signal on top
2020-05-25 11:47:16 -07:00
Hugo Locurcio
a53ab27329 Add file name conventions in the GDScript style guide (#3355)
This closes #2376.
2020-05-04 19:07:29 +02:00
Hugo Locurcio
ac4c28d279 Add advice about local variables in the GDScript and C# style guides 2020-04-15 11:45:23 +02:00
Hugo Locurcio
32d9019e5e Always use parentheses when calling assert() in GDScript
This is now required since Godot 3.2.

This also adds an assert message to the Godot interfaces page to match
its C# counterpart.
2020-04-09 14:46:36 +02:00
Yuri Sizov
37604be65f Improved keystroke formatting for shortcuts and key press menti… (#3257) 2020-03-09 23:50:53 +01:00
Michael Alexsander
91df8e4ed2 Apply minor fixups to the GDScript styleguide 2020-02-05 22:19:23 -03:00
Michael Alexsander
ecc41a15f4 Fix trailing comma examples in style guide page 2020-01-23 16:00:31 -03:00
Feniks
98bcb8af4a Updated style guide to include enums and dir in exception to 2… (#3082)
It appears that general consensus across the docs is that 2 indents for continuous line rule does not apply to enums and dictionaries. This is not mentioned in docs which is confusing to anyone who doesn't know about unofficial exception. This commit makes it official
2020-01-22 15:15:14 +01:00
Michael Alexsander
83511dc224 Fix nonexistent reference in the "GDScript style guide" page 2020-01-14 18:26:02 -03:00
Nathan Lovato
9a64d9a5c5 GDScript style guide: add suggested code order (#3022)
* GDScript style guide: add suggested code order

Following the discussion in #2997

* Update the code order example in the GDScript style guide
2020-01-14 18:23:24 +01:00
Nathan Lovato
dcb9cb43e8 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
2020-01-06 13:55:46 +01:00
Aaron Franke
766e4687e5 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.
2020-01-04 16:59:52 -05:00
Nathan Lovato
f56dee8d22 Change phrasing of the line length gdscript guideline. 2020-01-02 20:26:43 +01:00
Nathan Lovato
373f662571 Merge pull request #2994 from Calinou/add-gdscript-line-length-guideline
Add a line length guideline to the GDScript style guide
2020-01-02 20:08:58 +01:00
Nathan Lovato
60b8b5b11b Fix typo before comment 2020-01-02 09:48:10 +01:00
Nathan Lovato
176d4482be Edit gdscript_styleguide 2019-12-31 20:26:33 +01:00
Nathan Lovato
0321330075 Merge pull request #2995 from Calinou/add-gdscript-boolean-operators-guideline
Add a boolean operators guideline to the GDScript style guide
2019-12-31 19:46:45 +01:00
Hugo Locurcio
f3aaa480e2 Add an enum naming guideline to the GDScript style guide
This partially addresses #1736.
2019-12-20 19:31:16 +01:00
Hugo Locurcio
c6fa2483f8 Add a boolean operators guideline to the GDScript style guide 2019-12-20 19:17:11 +01:00
Hugo Locurcio
bc47ace471 Add a line length guideline to the GDScript style guide
This closes #2567.
2019-12-20 19:06:56 +01:00
Nathan Lovato
82dd565936 Change less -> fewer 2019-11-25 11:04:02 +01:00
Hugo Locurcio
193b866848 Add quote style recommendation to the GDScript style guide
This closes #2869.
2019-11-14 15:00:28 +01:00
Aaron Franke
1dfb69578c GDScript style guide: Add comments section, and change quotes (#2868)
* Add section about spacing comments

* Replace single quotes with double quotes
2019-10-23 13:32:24 +02:00
Nathan Lovato
5bd6fcf3bd Update the GDScript styleguide
Add a note about type hints, closes #2506
Recommend to skip 2 lines between functions to help make the code easier to read, closes #2505
2019-06-15 12:10:07 +09:00
corrigentia
c31ca4063d Update gdscript_styleguide.rst 2018-12-05 16:59:16 +02:00
Rémi Verschelde
e3b9e56516 Fix capitalization of some headers 2018-10-25 15:52:04 +02:00
Chris Bradfield
85d4e8757a Add Signals tutorial to "Step by step" 2018-09-21 08:25:55 -07:00
Michael Alexsander Silva Dias
e173600c79 Various fixes to the "Scripting -> GDScript" to respect the GDScript style guide. 2018-04-23 02:31:55 -03:00
Nathan
18f889b6a4 Improve docs structure
Change Step by Step in Getting Started
Remove Engine Features category, move into a new Tutorials top-level section
2018-01-25 08:54:27 +01:00