54 Commits

Author SHA1 Message Date
wk-y
67ce5abf2b Change 'subclasses' to 'inner classes' in style guide 2025-11-12 15:55:52 -08:00
Danil Alexeev
3946ede7aa Replace remaining uses of shorthand codeblock syntax, add CI check 2025-07-25 16:20:16 -04:00
Danil Alexeev
7a7ac7dc2d GDScript: Document abstract and variadic functions 2025-06-24 10:25:49 +03:00
Hugo Locurcio
db2bc419a3 Document abstract classes in GDScript 2025-05-14 01:31:02 +02:00
Matthew
8c18714228 Merge pull request #10780 from Lexyth/patch-2
Update Enum names, improve enum member names, and add related suggestion
2025-04-11 11:59:57 -04:00
Matthew
1335f389ec Merge pull request #10781 from Lexyth/patch-3
Clarify type-safety of as
2025-04-06 19:29:18 -04:00
Lexyth
571a85decf Update line length
Reduced the line length to make it more readable.

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2025-03-23 15:21:15 +01:00
Lexyth
8609443a5b Update format
Used code-block format for "null" keyword.

Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2025-03-23 11:15:29 +01:00
Lexyth
4b04e656cd Remove Good example title from as keyword example
Removed Good example title from the example for the "as" keyword, as it is a neutral example.
2025-03-23 11:11:58 +01:00
Lexyth
014031046a Fix good/bad example order
Moved the bad example below the good example to stay consistent with previous instances.
2025-03-23 11:08:24 +01:00
Lexyth
58c9fdb6b5 Clarify null-safety vs type-safety
Changed the statement about the "as" keyword to clarify that it affects null-safety, not type-safety.
2025-03-23 10:28:47 +01:00
Lexyth
5a46a02f4b Fix misplaced bad example
Moved the bad example for the inferred type for functions that return super types directly after its related statement.
2025-03-19 00:42:37 +01:00
Lexyth
7b7952ae71 Clarify type-safety of as
Changed the statement about the as keyword's type-safety to clarify that it is less type-safe than type hints.
2025-03-19 00:37:10 +01:00
Lexyth
49b3281d13 Update Enum names, improve enum member names, and add related suggestion
- Changed the grammatical number of all enum names to be singular.
- Removed the enum names from their members, (e.g.: Tile.TILE_BRICK -> Tile.BRICK).
- Added a suggestion for the reader to use singular case for enum names.
2025-03-19 00:09:04 +01:00
Matthew
59a53252ec Merge pull request #10659 from tetrapod00/doc-not-toc
Update links to C# and GDScript sections
2025-02-22 08:13:44 -05:00
Hugo Locurcio
8d9085ae7c Add guidelines on inline comments in GDScript style guide (#9433)
* Add guidelines on inline comments in GDScript style guide
2025-02-15 23:03:26 -05:00
tetrapod00
048bb2775e Update links to C# and GDScript sections
- Change all links to '_doc' anchors instead of 'toc's.
- Move 'doc_c_sharp' and 'doc_gdscript' to the index pages.
- Add 'doc_gdscript_reference' anchor.
- Update all existing links to point to the right place,
updating grammar if needed.
2025-02-09 16:16:43 -08:00
Martin Beaussart
d18c89ba71 Update code order with static annotation on gdscript_styleguide.rst (#8920)
* Update code order with static annotation on gdscript_styleguide.rst

Update code order on gdscript_styleguide.rst
by inserting static variables and methods on the code order as a proposal
2025-01-25 12:06:20 -05:00
Hugo Locurcio
265397c5fc Add @icon ordering to the GDScript style guide 2025-01-13 17:25:42 +01:00
tetrapod00
c1310e6009 Add GDScript naming convention summary table
Co-Authored-By: Edwin <60202421+emarino135@users.noreply.github.com>
Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-11-20 14:40:36 -08:00
tetrapod00
3bc5ea85af Remove references to 3.x minor versions
Removes notes about features being introduced in 3.x minor versions. In 4.x, these
details are no longer relevant.
2024-10-20 15:35:32 -07:00
tetrapod00
a6484f9841 Fix docstring written as comment 2024-10-19 11:31:59 -07:00
Hugo Locurcio
960125f576 Fix Code order section saying it's the first section in GDScript style guide
It's not the first section of the page anymore.
2024-09-23 23:58:39 +02:00
Jace Bennest
d71c24c699 Update gdscript_styleguide.rst
fixes typo
2024-08-04 10:48:19 -07:00
Hana - Piralein
3e2a8f6f7c Update outdated annotation and setget syntax
Co-Authored-By: PoolloverNathan <24194027+PoolloverNathan@users.noreply.github.com>
Co-Authored-By: Solor Vox <1246172+solorvox@users.noreply.github.com>
2024-06-27 22:13:37 +02:00
Hugo Locurcio
71cdbdd055 Tweak guidelines on dictionary and enum formatting in GDScript style guide
- Recommend writing each enum item on its own line, similar to C++.
- Recommend using spaces around inline dictionary declarations
  to make them easier to distinguish from arrays (due to similar-looking
  `[]` and `{}` characters in most fonts). This is commonly found
  in Python or JavaScript style guides.
2024-05-29 17:52:29 +02:00
444B
3d441150b1 Update gdscript_styleguide.rst - clarified sentence and grammar (#9110)
* Update gdscript_styleguide.rst - clarified sentence and grammar

- Clarified the statement on "One statement per line"
- Removed unclear sentence with incorrect grammar

---------

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-03-21 11:49:25 +01:00
Peter Anderson
ab98451bc8 Re-word 'Comment spacing' note in gdscript_styleguide.rst 2024-01-22 05:14:52 +00:00
oujionghong
c925bcd76f Fixing guide example on 2 indent levels for continuation lines
The original example seems to be using 3 tabs for indentation, but the description said 2 should be used.
2023-11-17 10:16:32 +08:00
Hugo Locurcio
54331c3c8f Document support for code folding regions in GDScript reference 2023-11-06 22:49:28 +01:00
Elnar Dakeshov
4b6e15d3b3 Update style guide (#8038)
Used get instead of set.
2023-09-27 03:03:08 +02:00
Hannes
085d4035a3 Changed a code example that didn't follow the style guide 2023-06-26 11:42:11 +02:00
Danil Alexeev
d8e71f7453 Update info about BBCode in doc comments and Class Reference 2023-05-29 21:43:10 +03:00
Max Hilbrunner
ebf3a02dbc Merge pull request #6498 from vmedea/2022-12-style-guide
Update style guide for new export and setget syntax
2023-03-23 04:46:52 +01:00
Justin McGettigan
7f7042c515 Updated instances of onready to @onready. 2023-03-18 16:06:11 -04:00
Thiago Lages de Alencar
8a112dcef2 Add bang operator to operators table (#6558)
* Add bang operator to operators table

* Add symbolic aliases for `and` & `or`

* Remove comma from operators table

* Add bang to the aliases list

---------

Co-authored-by: Max Hilbrunner <mhilbrunner@users.noreply.github.com>
2023-02-27 07:37:17 +01:00
Thiago Lages de Alencar
6095b20174 Add bang operator to gdscript style guide (#6828) 2023-02-27 07:19:38 +01:00
Mara Huldra
59c4480051 Update style guide for new signal emit/connect syntax 2023-02-07 22:03:04 +01:00
Mara Huldra
6336d03a3a Update style guide for new export and setget syntax 2023-02-07 22:00:35 +01:00
Aaron Franke
370f936922 GDScript style guide: Improve type inference section (#6661) 2023-02-05 16:33:38 +03:00
Jonathan Deiss
bec737cb75 Update gdscript_styleguide.rst (#6379)
Adds two changes:
- makes it clear where subclasses should go (at the bottom of the script)
- put the `_enter_tree()` method before `_ready()` but after `_init()` since that's the order in which the methods are executed
2023-02-05 16:19:27 +03:00
notPelf
beb5f02422 Clarify ternary operator in the style guide
In the current style guide, the example for ternary operators includes a "not" in the conditional which is the same text color as the preceding "if" giving the impression that the format for a ternary operation is "[some_value] if not [condition] else [other_value]" which is incorrect, and may be confusing to figure out. I'm new to Godot and I've never used python (which I understand GDScript is based on). My only experience is with c# which I don't believe has a "not" keyword so I was quite confused by this.

This change would remove "not" from the condition to eliminate confusion, and rearrange the values to keep the meaning of the example code the same. Any alternative that removes the "not" would also work.
2023-02-01 18:41:48 -05:00
BlueStag
135ad68cab Use 4.0 method of connecting to and emitting signals (#6311)
Change docs to use the new method of connecting and emitting signals
2023-01-22 22:01:34 -05:00
Max Hilbrunner
024fedb0f3 Kinematic -> Character 2022-10-15 17:55:24 +02:00
Evanaellio
3cb674285e Fix references to the @tool annotation 2022-09-21 22:48:04 +02:00
Markus Sauermann
57a9ef3fea Add @ to onready annotated variables in examples 2022-02-04 19:33:10 +01:00
Max Hilbrunner
7b758e4739 Merge pull request #5326 from zacryol/inferred-typing-cast
Show example of casting get_node() for static typing in style guide
2021-11-03 14:43:45 +01:00
zacryol
35211f6002 Show example of casting get_node() for inferred static typing in style guide 2021-10-22 11:04:56 -06:00
zacryol
8b5fb7a39d Rename var "character_dir" to "character_dict" in GDScript style guide (#5325) 2021-10-16 01:12:08 +02:00
merumelu
41a3150726 GDScript style guide: tint borders of good/bad code examples (#5138)
Add `rst-class` directives before code blocks to allow custom styling.
2021-08-01 16:09:09 +02:00