summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-05 22:59:24 +0100
committerskal <pascal.massimino@gmail.com>2026-03-05 22:59:24 +0100
commitd04227be6026454740ff8940150c618445b35480 (patch)
tree49847f2419f49b9853520f15f62404c0d4a9f39e
parent34afbd6ca21d2b960573d787e6eae46fa86b200e (diff)
docs: add control flow braces rule to coding style
-rw-r--r--doc/CODING_STYLE.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/CODING_STYLE.md b/doc/CODING_STYLE.md
index 57d4478..ba3fcb5 100644
--- a/doc/CODING_STYLE.md
+++ b/doc/CODING_STYLE.md
@@ -108,6 +108,25 @@ Use designated initializers, not field-by-field assignment.
---
+## Control Flow Braces
+
+**Rule:** Multi-line `for` or `if` statements must use curly braces.
+
+### Good
+```cpp
+for (int i = 0; i < 10; ++i) {
+ do_something(i);
+}
+```
+
+### Bad
+```cpp
+for (int i = 0; i < 10; ++i)
+ do_something(i);
+```
+
+---
+
## Class Keywords Indentation
```cpp