mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-23 00:39:52 +00:00
tools: clang-format rule update
Signed-off-by: songzhengteng <songzhengteng@huawei.com>
This commit is contained in:
parent
4087b5584d
commit
8c431f9ea6
@ -1,9 +1,20 @@
|
|||||||
|
# Run command below to format a file
|
||||||
|
# clang-format -i --style=file <file>
|
||||||
|
|
||||||
|
# complete clang-format rule, reference:
|
||||||
|
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||||
|
|
||||||
|
# WebKit format rule details, reference:
|
||||||
|
# https://webkit.org/code-style-guidelines/
|
||||||
|
# https://gitee.com/mirrors/WebKit/blob/main/.clang-format
|
||||||
BasedOnStyle: Webkit
|
BasedOnStyle: Webkit
|
||||||
ColumnLimit: 120
|
# works on C and C++ files
|
||||||
|
Language: Cpp
|
||||||
|
|
||||||
PointerAlignment: Right
|
PointerAlignment: Right
|
||||||
AlignAfterOpenBracket: DontAlign
|
|
||||||
AlignTrailingComments: true
|
AlignTrailingComments: true
|
||||||
AlignConsecutiveMacros: Consecutive
|
AlignConsecutiveMacros: Consecutive
|
||||||
|
# case statements indent one layer
|
||||||
IndentCaseLabels: true
|
IndentCaseLabels: true
|
||||||
BreakBeforeBinaryOperators: None
|
BreakBeforeBinaryOperators: None
|
||||||
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||||
@ -11,19 +22,19 @@ SpacesInCStyleCastParentheses: false
|
|||||||
AlignEscapedNewlines: Left
|
AlignEscapedNewlines: Left
|
||||||
NamespaceIndentation: None
|
NamespaceIndentation: None
|
||||||
FixNamespaceComments: true
|
FixNamespaceComments: true
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|
||||||
BreakConstructorInitializers: AfterColon
|
BreakConstructorInitializers: AfterColon
|
||||||
AlignArrayOfStructures: Left
|
AlignArrayOfStructures: Left
|
||||||
AllowShortFunctionsOnASingleLine: Empty
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
AllowShortLambdasOnASingleLine: Empty
|
AllowShortLambdasOnASingleLine: Empty
|
||||||
AlwaysBreakTemplateDeclarations: true
|
AlwaysBreakTemplateDeclarations: true
|
||||||
SpaceInEmptyBlock: false
|
|
||||||
LambdaBodyIndentation: Signature
|
|
||||||
BreakBeforeTernaryOperators: false
|
BreakBeforeTernaryOperators: false
|
||||||
Cpp11BracedListStyle: true
|
|
||||||
SpaceAroundPointerQualifiers: Both
|
SpaceAroundPointerQualifiers: Both
|
||||||
|
# iterator macros declaretion,avoid being treated as function call
|
||||||
ForEachMacros:
|
ForEachMacros:
|
||||||
- 'DLIST_FOR_EACH_ENTRY'
|
- 'LIST_FOR_EACH_ENTRY'
|
||||||
- 'DLIST_FOR_EACH_ENTRY_REVERSE'
|
- 'LIST_FOR_EACH_ENTRY_SAFE'
|
||||||
- 'DLIST_FOR_EACH_ENTRY_SAFE'
|
- 'LIST_FOR_EACH'
|
||||||
|
- 'LIST_FOR_EACH_SAFE'
|
||||||
|
SortIncludes: CaseInsensitive
|
||||||
|
AllowShortEnumsOnASingleLine: false
|
||||||
|
ColumnLimit: 120
|
Loading…
Reference in New Issue
Block a user