aboutsummaryrefslogtreecommitdiff
path: root/contributing.md
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-04 08:28:18 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-04 08:28:18 +0100
commit06f65659fc6ffde7cabd2135040cbfbf089e5a24 (patch)
treee3570bea52b87b6919550ee81d17927ccbc11cc5 /contributing.md
parent128969619a22dfc17a9ea35335c0d21c6ad0c954 (diff)
parent6aa8fdd04728b6a499f526de727514ae3d0490b4 (diff)
merge `origin/master` into `master`
Diffstat (limited to 'contributing.md')
-rw-r--r--contributing.md16
1 files changed, 15 insertions, 1 deletions
diff --git a/contributing.md b/contributing.md
index e5d4bd8..775119a 100644
--- a/contributing.md
+++ b/contributing.md
@@ -14,6 +14,7 @@
- TODO: tagging / versions
+
# Code style
- ASCII only
@@ -25,6 +26,11 @@
decisions
- Formatting nitty-gritty is handled by clang-format/clang-tidy (run `make
format` in the root folder of this repository to format all sources files)
+- Header includes are split into paragraphs separated by a blank line. The
+ order is:
+ 1. system headers (using `<`brackets`>`)
+ 2. relative headers NOT in the same folder as the current file
+ 3. relative headers in the same folder as the current file
- When using libraries of which the header include order is important, make
sure to separate the include statements using a blank line (clang-format may
sort include statements, but does not sort across empty lines).
@@ -32,7 +38,7 @@
user-facing APIs under `crepe::api` (the folder structure should also reflect
this).
- `using namespace` may not be used in header files, only in source files.
-- Do not (indirectly) include private dependency headers in API header files,
+- Do not (indirectly) include private *dependency* headers in API header files,
as these are no longer accessible when the engine is installed
- Getter and setter functions are appropriately prefixed with `get_` and
`set_`.
@@ -64,6 +70,14 @@
- When calling template factory methods that explicitly name the return type
in the function call signature
- When fetching a singleton instance
+- Only use member initializer lists for non-trivial types.
+- C++-style structs should define default values for all non-trivial fields.
+- Declare incomplete classes instead of including the relevant header where
+ possible (i.e. if you only need a reference or pointer type).
+- Template functions are only declared in a `.h` header, and defined in a
+ matching `.hpp` header.
+- Where possible, end (initializer) lists with a trailing comma (e.g. with
+ structs, enums)
## CMakeLists specific