From d04227be6026454740ff8940150c618445b35480 Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 5 Mar 2026 22:59:24 +0100 Subject: docs: add control flow braces rule to coding style --- doc/CODING_STYLE.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc') 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 -- cgit v1.2.3