Issue description:
There's little information regarding existing code style used throughout Godot's C++ codebase in the docs, unlike GDScript and C#. This is important to document to ensure Godot follows consistent code style, and especially important for new contributors.
See godotengine/godot#33027 for consensus regarding C++ code style in Godot. To summarize:
Formatting
No empty line after opening brace (enforced by clang-format).
One line between function implementations (no tools found yet).
Use braces on single-statement if / else blocks (might be doable with clang-tidy).
No short case labels on a single line (can be enforced by clang-format).
Switch/case use of brackets (undecided).
Code style
snake_case for identifiers (variables).
PascalCase for classes.
SHOUTING_SNAKE_CASE for constants.
Use p_ for method parameters, and r_ for parameters which are intended to "return" something (modified by the method).
Naming of boolean setters/getters (no consensus yet, see godotengine/godot#33026).
URL to the documentation page (if already existing):
Can be added to the "Code style guidelines" page.
It should also be noted that m_ is seemingly the preferred prefix for macro parameters. p_ and r_ are mentioned in the docs (though not in the coding style doc), but searching for m_ comes up blank.
Your Godot version: Any.
Issue description: There's little information regarding existing code style used throughout Godot's C++ codebase in the docs, unlike GDScript and C#. This is important to document to ensure Godot follows consistent code style, and especially important for new contributors.
See godotengine/godot#33027 for consensus regarding C++ code style in Godot. To summarize:
Formatting
clang-format
).clang-tidy
).clang-format
).Code style
snake_case
for identifiers (variables).PascalCase
for classes.SHOUTING_SNAKE_CASE
for constants.p_
for method parameters, andr_
for parameters which are intended to "return" something (modified by the method).URL to the documentation page (if already existing): Can be added to the "Code style guidelines" page.