The .editorconfig
and clang-format
tools are used to enforce style guides. Ensure support for these is enabled in your editor for the smoothest experience.
Every file should contain the following copyright header:
// Copyright by Potato Engine contributors. See accompanying License.txt for copyright details.
Indentation uses four (4) spaces. Never tabs.
Spacing around binary operators: 1 + 1
Spacing after control keywords and parenthesis: if (test)
No spacing around function name or argument: foo(bar, baz)
Braces are on the opening line, but never trail on closing lines:
if (test) {
true_body;
}
else {
false_false;
}
Namespaces are snake_case or preferably short abbreviations.
Classes are in PascalCase, also called UpperCamelCase.
Functions are in camelCase, also called lowerCamelCase.
Variables and local constants are in snake_case. Global constants are in UPPER_CASE.