From 405483a00d783871251d76c4fb6e03350ed67160 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Thu, 3 Sep 2026 10:30:22 +0300 Subject: [PATCH] - add clang-format settings --- .clang-format | 69 ++++++++++++++++++++++++++++++++++++++++++++ .clang-format-ignore | 2 ++ 2 files changed, 71 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-format-ignore diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..e7017e23 --- /dev/null +++ b/.clang-format @@ -0,0 +1,69 @@ +# Formatting rules for rtphone's own C++ sources (src/engine, src/libs/ice, test). +# Third-party code under src/libs/ is excluded via .clang-format-ignore. +--- +Language: Cpp +BasedOnStyle: LLVM +Standard: c++20 + +# Indentation: 4 columns, spaces only. +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +AccessModifierOffset: -4 +NamespaceIndentation: None +IndentCaseLabels: false + +ColumnLimit: 120 + +# Allman braces, as used throughout the codebase. +BreakBeforeBraces: Allman + +PointerAlignment: Left +ReferenceAlignment: Left +DerivePointerAlignment: false + +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortBlocksOnASingleLine: Empty + +# Include order matters here (platform headers, windows.h, vendored libs), +# so never reorder them. +SortIncludes: Never +IndentPPDirectives: None +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: 2 +FixNamespaceComments: true +SpaceAfterTemplateKeyword: false +AlwaysBreakTemplateDeclarations: Yes +AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments + +# Objective-C++ (src/libs/ice/ICEIosSupport.mm) — same rules as C++. +--- +Language: ObjC +BasedOnStyle: LLVM +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +AccessModifierOffset: -4 +NamespaceIndentation: None +IndentCaseLabels: false +ColumnLimit: 120 +BreakBeforeBraces: Allman +PointerAlignment: Left +ReferenceAlignment: Left +DerivePointerAlignment: false +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortBlocksOnASingleLine: Empty +SortIncludes: Never +IndentPPDirectives: None +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: 2 +FixNamespaceComments: true +AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 00000000..b02911d0 --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1,2 @@ +src/libs/** +!src/libs/ice/ICE*