diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md index d6580bbbec..51551962f5 100644 --- a/docs/CODING_STYLE.md +++ b/docs/CODING_STYLE.md @@ -94,6 +94,28 @@ SPDX-License-Identifier: LGPL-2.1-or-later } ``` +- Braces in `if` blocks are not required to be symmetric. Write this: + + ```c + if (foobar) + waldo(); + else { + foo(); + bar(); + } + ``` + + instead of this: + + ```c + if (foobar) { + waldo(); + } else { + foo(); + bar(); + } + ``` + - Do not write `foo ()`, write `foo()`. - `else` blocks should generally start on the same line as the closing `}`: