Adding clang format 11/243611/2
authorDavid Steele <david.steele@samsung.com>
Mon, 7 Sep 2020 16:08:01 +0000 (17:08 +0100)
committerDavid Steele <david.steele@samsung.com>
Thu, 10 Sep 2020 10:26:34 +0000 (11:26 +0100)
Closely follows new dali-style

Change-Id: I285743bf054dfbb04809ec995e47f00426134889

.clang-format [new file with mode: 0644]
dali-toolkit/third-party/.clang-format [new file with mode: 0644]
format [new file with mode: 0755]

diff --git a/.clang-format b/.clang-format
new file mode 100644 (file)
index 0000000..d314ca1
--- /dev/null
@@ -0,0 +1,96 @@
+---
+Language:        Cpp
+BasedOnStyle:  Google
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: true
+AlignEscapedNewlinesLeft: true
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: false
+BinPackParameters: false
+BraceWrapping:
+  AfterClass:      true
+  AfterControlStatement: true
+  AfterEnum:       true
+  AfterFunction:   true
+  AfterNamespace:  true
+  AfterObjCDeclaration: false
+  AfterStruct:     true
+  AfterUnion:      true
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Allman
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializers: BeforeColon
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+AllowAllConstructorInitializersOnNextLine : false
+ConstructorInitializerIndentWidth: 0
+ColumnLimit:     0
+CommentPragmas:  '^ IWYU pragma:'
+ContinuationIndentWidth: 2
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeBlocks: Preserve
+IncludeCategories:
+  - Regex:           '^<.*\.h>'
+    Priority:        1
+  - Regex:           '^<.*'
+    Priority:        2
+  - Regex:           '.*'
+    Priority:        3
+SpaceBeforeCtorInitializerColon: false
+IndentCaseLabels: true
+IndentWidth:     2
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: '^DALI_ENUM_TO_STRING_TABLE_BEGIN'
+MacroBlockEnd:   'DALI_ENUM_TO_STRING_TABLE_END'
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakBeforeFirstCallParameter: 1
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+ReflowComments:  true
+SortIncludes:    true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: Never
+SpaceInEmptyParentheses: false
+SpacesInConditionalStatement : false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+SpaceAfterTemplateKeyword: false
+Standard:        Auto
+TabWidth:        2
+UseTab:          Never
+...
diff --git a/dali-toolkit/third-party/.clang-format b/dali-toolkit/third-party/.clang-format
new file mode 100644 (file)
index 0000000..297ddc2
--- /dev/null
@@ -0,0 +1,5 @@
+---
+Language:        Cpp
+DisableFormat: true
+SortIncludes: false
+...
diff --git a/format b/format
new file mode 100755 (executable)
index 0000000..c5630b4
--- /dev/null
+++ b/format
@@ -0,0 +1 @@
+git diff -U0 --no-color HEAD^ | clang-format-diff -i -p1
\ No newline at end of file