Add Code Guidelines - #7110
Draft
Pepe20129 wants to merge 13 commits into
Draft
Conversation
Doesn't really need to be specified but just incase.
serprex
reviewed
Aug 23, 2026
| See these compatibility tables ([C](https://en.cppreference.com/c/compiler_support), [C++](https://en.cppreference.com/cpp/compiler_support)) for which features are supported by each compiler. | ||
|
|
||
| Do not use: | ||
| - [`goto`](https://en.cppreference.com/cpp/language/goto). |
Member
There was a problem hiding this comment.
rg "\bgoto\b" | wc -l lists 855. goto has a place. the main trouble is when goto is jumping backwards
Contributor
Author
There was a problem hiding this comment.
These guidelines are not for decomp code, in soh/soh/ there's only 3 uses of it:
OTRGlobals.cpp
484: goto render;
resource\importer\AudioSoundFontFactory.cpp
379: goto skip;
Enhancements\randomizer\3drando\fill.cpp
582: goto resetSphere;
Also see section ES.76 of the C++ Core Guidelines.
serprex
reviewed
Aug 23, 2026
Co-authored-by: Philip Dubé <159546+serprex@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
docs/CODE_GUIDELINES.md, this is a draft PR as there's still a lot of discussion to be had.Currently the line about using libultra types over std ones is commented out as there's no consensus on it.
Github slightly messed up the rendering in the PR view, here's the correct rendering.
Build Artifacts