xref: /openbmc/docs/style/cpp/.clang-format (revision f4febd00)
1---
2Language:        Cpp
3# BasedOnStyle:  LLVM
4AccessModifierOffset: -2
5AlignAfterOpenBracket: Align
6AlignConsecutiveAssignments: false
7AlignConsecutiveDeclarations: false
8AlignEscapedNewlines: Right
9AlignOperands:  Align
10AlignTrailingComments: true
11AllowAllParametersOfDeclarationOnNextLine: true
12AllowShortBlocksOnASingleLine: Empty
13AllowShortCaseLabelsOnASingleLine: false
14AllowShortFunctionsOnASingleLine: Empty
15AllowShortIfStatementsOnASingleLine: false
16AllowShortLoopsOnASingleLine: false
17AlwaysBreakAfterReturnType: None
18AlwaysBreakBeforeMultilineStrings: false
19AlwaysBreakTemplateDeclarations: Yes
20BinPackArguments: true
21BinPackParameters: true
22BraceWrapping:
23  AfterCaseLabel:  true
24  AfterClass:      true
25  AfterControlStatement: true
26  AfterEnum:       true
27  AfterFunction:   true
28  AfterNamespace:  true
29  AfterObjCDeclaration: true
30  AfterStruct:     true
31  AfterUnion:      true
32  AfterExternBlock: true
33  BeforeCatch:     true
34  BeforeElse:      true
35  IndentBraces:    false
36  SplitEmptyFunction:   false
37  SplitEmptyRecord:     false
38  SplitEmptyNamespace:  false
39BreakBeforeBinaryOperators: None
40BreakBeforeBraces: Custom
41BreakBeforeTernaryOperators: true
42BreakConstructorInitializers: AfterColon
43BreakInheritanceList: AfterColon
44BreakStringLiterals: false
45ColumnLimit:     80
46CommentPragmas:  '^ IWYU pragma:'
47CompactNamespaces: false
48ConstructorInitializerAllOnOneLineOrOnePerLine: false
49ConstructorInitializerIndentWidth: 4
50ContinuationIndentWidth: 4
51Cpp11BracedListStyle: true
52DeriveLineEnding: false
53DerivePointerAlignment: false
54PointerAlignment: Left
55DisableFormat:   false
56ExperimentalAutoDetectBinPacking: false
57FixNamespaceComments: true
58ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
59IncludeBlocks: Regroup
60IncludeCategories:
61  - Regex:           '^[<"](gtest|gmock)'
62    Priority:        7
63  - Regex:           '^"config.h"'
64    Priority:        -1
65  - Regex:           '^".*\.h"'
66    Priority:        1
67  - Regex:           '^".*\.hpp"'
68    Priority:        2
69  - Regex:           '^<.*\.h>'
70    Priority:        3
71  - Regex:           '^<.*\.hpp>'
72    Priority:        4
73  - Regex:           '^<.*'
74    Priority:        5
75  - Regex:           '.*'
76    Priority:        6
77IndentCaseLabels: true
78IndentRequiresClause: true
79IndentWidth:     4
80IndentWrappedFunctionNames: true
81KeepEmptyLinesAtTheStartOfBlocks: false
82MacroBlockBegin: ''
83MacroBlockEnd:   ''
84MaxEmptyLinesToKeep: 1
85NamespaceIndentation: None
86ObjCBlockIndentWidth: 2
87ObjCSpaceAfterProperty: false
88ObjCSpaceBeforeProtocolList: true
89PenaltyBreakAssignment: 25
90PenaltyBreakBeforeFirstCallParameter: 19
91PenaltyBreakComment: 300
92PenaltyBreakFirstLessLess: 120
93PenaltyBreakString: 1000
94PenaltyExcessCharacter: 1000000
95PenaltyReturnTypeOnItsOwnLine: 60
96PenaltyIndentedWhitespace: 0
97QualifierAlignment: Left
98ReferenceAlignment: Left
99ReflowComments:  true
100RequiresClausePosition: OwnLine
101SortIncludes:    true
102SortUsingDeclarations: true
103SpaceAfterCStyleCast: false
104SpaceAfterTemplateKeyword: true
105SpaceBeforeAssignmentOperators: true
106SpaceBeforeCpp11BracedList: false
107SpaceBeforeCtorInitializerColon: true
108SpaceBeforeInheritanceColon: true
109SpaceBeforeParens: ControlStatements
110SpaceBeforeRangeBasedForLoopColon: true
111SpaceInEmptyParentheses: false
112SpacesBeforeTrailingComments: 1
113SpacesInAngles:  false
114SpacesInContainerLiterals: true
115SpacesInCStyleCastParentheses: false
116SpacesInParentheses: false
117SpacesInSquareBrackets: false
118Standard:        Latest
119TabWidth:        4
120UseCRLF: false
121UseTab:          Never
122...
123
124