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