1060ff233Sopenharmony_ci# Run command below to format a file
2060ff233Sopenharmony_ci# clang-format -i --style=file <file>
3060ff233Sopenharmony_ci
4060ff233Sopenharmony_ci# complete clang-format rule, reference:
5060ff233Sopenharmony_ci# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
6060ff233Sopenharmony_ci
7060ff233Sopenharmony_ci# WebKit format rule details, reference:
8060ff233Sopenharmony_ci#   https://webkit.org/code-style-guidelines/
9060ff233Sopenharmony_ci#   https://gitee.com/mirrors/WebKit/blob/main/.clang-format
10060ff233Sopenharmony_ciBasedOnStyle: Webkit
11060ff233Sopenharmony_ci# works on C and C++ files
12060ff233Sopenharmony_ciLanguage: Cpp
13060ff233Sopenharmony_ci
14060ff233Sopenharmony_ciPointerAlignment: Right
15060ff233Sopenharmony_ciAlignTrailingComments: true
16060ff233Sopenharmony_ciAlignConsecutiveMacros: Consecutive
17060ff233Sopenharmony_ci# case statements indent one layer
18060ff233Sopenharmony_ciIndentCaseLabels: true
19060ff233Sopenharmony_ciBreakBeforeBinaryOperators: None
20060ff233Sopenharmony_ciSpaceBeforeParens: ControlStatementsExceptControlMacros
21060ff233Sopenharmony_ciSpacesInCStyleCastParentheses: false
22060ff233Sopenharmony_ciAlignEscapedNewlines: Left
23060ff233Sopenharmony_ciNamespaceIndentation: None
24060ff233Sopenharmony_ciFixNamespaceComments: true
25060ff233Sopenharmony_ciBreakConstructorInitializers: AfterColon
26060ff233Sopenharmony_ciAlignArrayOfStructures: Left
27060ff233Sopenharmony_ciAllowShortFunctionsOnASingleLine: Empty
28060ff233Sopenharmony_ciAllowShortLambdasOnASingleLine: Empty
29060ff233Sopenharmony_ciAlwaysBreakTemplateDeclarations: true
30060ff233Sopenharmony_ciBreakBeforeTernaryOperators: false
31060ff233Sopenharmony_ciSpaceAroundPointerQualifiers: Both
32060ff233Sopenharmony_ci# iterator macros declaretion,avoid being treated as function call
33060ff233Sopenharmony_ciForEachMacros:
34060ff233Sopenharmony_ci  - 'LIST_FOR_EACH_ENTRY'
35060ff233Sopenharmony_ci  - 'LIST_FOR_EACH_ENTRY_SAFE'
36060ff233Sopenharmony_ci  - 'LIST_FOR_EACH'
37060ff233Sopenharmony_ci  - 'LIST_FOR_EACH_SAFE'
38060ff233Sopenharmony_ciSortIncludes: CaseInsensitive
39060ff233Sopenharmony_ciAllowShortEnumsOnASingleLine: false
40060ff233Sopenharmony_ciColumnLimit: 120