Skip to content

conventions: say why flip is spelled the Godot way - #311

Merged
Naruto merged 1 commit into
developfrom
conventions/say-why-flip-is-spelled-the-godot-way
Sep 13, 2026
Merged

conventions: say why flip is spelled the Godot way#311
Naruto merged 1 commit into
developfrom
conventions/say-why-flip-is-spelled-the-godot-way

Conversation

@Naruto

@Naruto Naruto commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

flip_h / flip_v with is_flipped_* readers is a departure: every sibling Player calls this pair flipX / flipY.

It is the right call here. Sprite2D and AnimatedSprite2D already put flip_h on a 2D node, so that is what a Godot user reaches for, and an inspector row called flip_x sitting beside a Sprite2D's flip_h would read as a different feature rather than the same one.

None of which was written down. §7 of the API conventions asks for the reason next to the code precisely because a departure with no stated reason is indistinguishable from a mistake to whoever reads it next — and the next reader of this file is someone auditing it against the family, who has no way to tell this from the drift they are hunting.

Comment only. No code, no behaviour, no API.

Verification

  • scripts/build-extension.sh — compiles and links. The duplicate _rust_eh_personality warning is pre-existing and unrelated.
  • scripts/run-tests.sh35 cases, 101 assertions, 0 failed, 0 skipped.

One thing worth knowing about that runner

The first invocation after a build segfaults in the editor's layout load (editor_node.cpp:6618, Parameter "singleton" is null) — after the suite has already printed SUITE FINISHED — and the script still exits 0. A re-run is clean. Not caused by this PR (a comment cannot change codegen), but an exit code of 0 following a crash is not a result, and this is the kind of thing that quietly turns into a green tick over a suite that never ran.

`flip_h` / `flip_v` with `is_flipped_*` readers is a departure: every
sibling Player calls this pair `flipX` / `flipY`. It is the right call
here — `Sprite2D` and `AnimatedSprite2D` already put `flip_h` on a 2D
node, so that is what a Godot user reaches for, and an inspector row
called `flip_x` sitting beside a Sprite2D's `flip_h` would read as a
different feature rather than the same one.

None of which was written down. §7 of the API conventions asks for the
reason next to the code precisely because a departure with no stated
reason is indistinguishable from a mistake to whoever reads it next —
and the next reader of this file is someone auditing it against the
family, who has no way to tell this from the drift they are hunting.

Comment only.

Rebuilt with scripts/build-extension.sh (compiles and links; the
duplicate `_rust_eh_personality` warning is pre-existing) and ran
scripts/run-tests.sh: 35 cases, 101 assertions, 0 failed, 0 skipped.
Note for whoever runs that next — the first invocation after a build
segfaults in the editor's layout load once the suite has already printed
SUITE FINISHED, and the script still exits 0. A re-run is clean. Worth
knowing, since an exit code of 0 after a crash is not a result.
@Naruto
Naruto merged commit 44c6a89 into develop Sep 13, 2026
0 of 2 checks passed
@Naruto
Naruto deleted the conventions/say-why-flip-is-spelled-the-godot-way branch September 13, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant