From 32bc6d21987e9861d9089228388f9aab5f4f43d1 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 6 Nov 2024 18:25:10 +0100 Subject: merge #21 --- contributing.md | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'contributing.md') diff --git a/contributing.md b/contributing.md index cea6e37..cd1b6a6 100644 --- a/contributing.md +++ b/contributing.md @@ -49,11 +49,11 @@ that you can click on to open them. class Cars {}; ``` -- Source files (.cpp, .hpp) contain the following types of comments: +- Source files (`.cpp`, `.hpp`) contain the following types of comments: - What is the code supposed to do (optional) - Implementation details (if applicable) -- Header files (.h) contain the following types of comments: - - Usage documentation (required) +- Header files (`.h`) contain the following types of comments: + - [Usage documentation](#documentation) (required) > [!NOTE] > Constructors/destructors aren't required to have a `\brief` description - Implementation details (if they affect the header) @@ -421,7 +421,7 @@ that you can click on to open them. ``` -
- Follow the rule-of-five + Follow the rule of five
GoodBad
```cpp @@ -429,10 +429,9 @@ that you can click on to open them. public: Foo(); ~Foo(); - Foo(const Foo &); Foo(Foo &&) noexcept; - Foo & operator=(const Foo &); - Foo & operator=(Foo &&) noexcept; + Foo & operator = (const Foo &); + Foo & operator = (Foo &&) noexcept; }; ``` @@ -442,7 +441,6 @@ that you can click on to open them. public: Foo(); ~Foo(); - Foo(const Foo &); }; ```
@@ -478,7 +476,7 @@ that you can click on to open them. ``` -
- File names (.h, .cpp, .hpp) should be written using CamelCase + Files should be named after the class/struct/interface they implement
GoodBad
```cpp @@ -495,7 +493,12 @@ that you can click on to open them. ```
-
- Implementation is not allowed in header files, except if the method only returns a constant value + Implementations are not allowed in header files, except if the implementation + + - is `= default` + - is `= delete` + - is `{}` (empty) + - only returns a constant literal
GoodBad
```cpp @@ -518,18 +521,24 @@ that you can click on to open them. ```
-
- Use angle brackets (<>) for including libraries and double quotes ("") for including local files. + Use angle brackets (<>) only for including system headers and + double quotes ("") for including other engine files. + + > [!NOTE] + > Only files in the examples folder should include engine headers with angle + > brackets
GoodBad
```cpp #include - #include "MyClass.h" + + #include "facade/Sound.h" ``` ```cpp - #include "iostream" - #include + #include + #include ```
-- cgit v1.2.3