Skip to content

Commit bf5c4b1

Browse files
committed
Expand GDScript guidelines with guidelines from the main repository.
1 parent 8bc0b6a commit bf5c4b1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

engine/guidelines/gdscript_language_guidelines.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
GDScript language design guidelines
22
===================================
33

4+
The :team:`GDScript` aims to avoid over-designing GDScript. Features are added when they
5+
are needed, and not just because they can be added or are interesting to develop.
6+
For more information, please refer to :ref:`doc_best_practices_for_engine_contributors`.
7+
8+
Typing guidelines
9+
-----------------
10+
11+
GDScript is gradually typed. Type hints are optional and help with static analysis and performance.
12+
However, typed code must easily interoperate with untyped code.
13+
14+
In addition, we expect new typing features to be guaranteed by Godot core. While other
15+
languages can rely on static typing alone to ensure type correctness, Godot exposes
16+
lots of ways to interact with the data such that this assumption might fail.
17+
Therefore, new typing features need to be guaranteed by core in order to be useful to
18+
GDScript.
19+
For example, `Array[int]` might be handled by Godot core as `Array` (without typing). That means
20+
that `Array[int]` must validate newly added elements to be `int`, to avoid non-int elements being
21+
added in other contexts.
22+
423
Annotation guidelines
524
---------------------
625

organization/areas.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ GDExtension and godot-cpp.
352352
:triage_project: <gh-triage project=81>GDExtension issue triage</gh-triage>
353353
:maintainers: Bastiaan Olij (@BastiaanOlij), <lead>David Snopek (@dsnopek)</lead>, Fabio Alessandrelli (@Faless), George Marques (@vnen), Gilles Roudière (@groud), Jan Haller (@Bromeon), Juan Linietsky (@reduz), Patrick Exner (@paddy-exe), Pāvels Nadtočajevs (@bruvzg), Rémi Verschelde (@akien-mga)
354354

355+
.. _team_gdscript:
356+
355357
GDScript
356358
~~~~~~~~
357359

0 commit comments

Comments
 (0)