diff options
-rw-r--r-- | doc/developer-notes.md | 9 | ||||
-rw-r--r-- | src/.clang-format | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 6b5311d3e3..1f237b750e 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -50,7 +50,7 @@ Do not submit patches solely to modify the style of existing code. [src/.clang-format](/src/.clang-format). You can use the provided [clang-format-diff script](/contrib/devtools/README.md#clang-format-diffpy) tool to clean up patches automatically before submission. - - Braces on new lines for namespaces, classes, functions, methods. + - Braces on new lines for classes, functions, methods. - Braces on the same line for everything else. - 4 space indentation (no tabs) for every block except namespaces. - No indentation for `public`/`protected`/`private` or for `namespace`. @@ -85,8 +85,7 @@ Block style example: ```c++ int g_count = 0; -namespace foo -{ +namespace foo { class Class { std::string m_name; @@ -585,11 +584,11 @@ Source code organization ```c++ namespace mynamespace { - ... +... } // namespace mynamespace namespace { - ... +... } // namespace ``` diff --git a/src/.clang-format b/src/.clang-format index 2d2ee67035..38e19edf2c 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -12,7 +12,10 @@ AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: true BinPackParameters: false BreakBeforeBinaryOperators: false -BreakBeforeBraces: Linux +BreakBeforeBraces: Custom +BraceWrapping: + AfterClass: true + AfterFunction: true BreakBeforeTernaryOperators: false BreakConstructorInitializersBeforeComma: false ColumnLimit: 0 |