-
Notifications
You must be signed in to change notification settings - Fork 285
/
.clang-format
156 lines (152 loc) · 4.25 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormatStyleOptions.html
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
CommentPragmas: ""
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros: [foreach, Q_FOREACH]
# Sort headers by main include file (implicit priority 0),
# then project and private includes, then system headers
IncludeCategories:
- Regex: '^".*\.h(pp)?"$' # headers relative to this project
Priority: 1
# DART headers
- Regex: '^<dart\/config.hpp>$'
Priority: 10
- Regex: '^<dart\/test\/.*\.h(pp)?>$'
Priority: 20
- Regex: '^<dart\/python\/.*\.h(pp)?>$'
Priority: 21
- Regex: '^<dart\/gui\/.*\.h(pp)?>$'
Priority: 22
- Regex: '^<dart\/utils\/.*\.h(pp)?>$'
Priority: 23
- Regex: '^<dart\/simulation\/.*\.h(pp)?>$'
Priority: 24
- Regex: '^<dart\/constraint\/.*\.h(pp)?>$'
Priority: 25
- Regex: '^<dart\/collision\/.*\.h(pp)?>$'
Priority: 26
- Regex: '^<dart\/dynamics\/.*\.h(pp)?>$'
Priority: 27
- Regex: '^<dart\/optimizer\/.*\.h(pp)?>$'
Priority: 28
- Regex: '^<dart\/lcpsolver\/.*\.h(pp)?>$'
Priority: 29
- Regex: '^<dart\/integration\/.*\.h(pp)?>$'
Priority: 30
- Regex: '^<dart\/math\/.*\.h(pp)?>$'
Priority: 31
- Regex: '^<dart\/common\/.*\.h(pp)?>$'
Priority: 32
- Regex: '^<dart\/common\/.*\.h(pp)?>$'
Priority: 33
- Regex: '^<dart\/.*\.h(pp)?>$'
Priority: 40
- Regex: '^<dart\/external\/.*\.h(pp)?>$'
Priority: 50
# 3rd-party headers
- Regex: '^<.*\.h(pp)?>$'
Priority: 50
- Regex: '^<.*\/.*>$'
Priority: 50
# C++ standard library headers, then C
# TODO(JS): Add when new C++ STL header begins with "c" is found
- Regex: "^<charconv>$"
Priority: 100
- Regex: "^<chrono>$"
Priority: 100
- Regex: "^<compare>$"
Priority: 100
- Regex: "^<complex>$"
Priority: 100
- Regex: "^<concepts>$"
Priority: 100
- Regex: "^<condition_variable>$"
Priority: 100
- Regex: "^<coroutine>$"
Priority: 100
- Regex: "^<c.*>$" # C standard library headers
Priority: 110
- Regex: "^<([a-z|_]+)>$"
Priority: 100
- Regex: ".*"
Priority: 999
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentFunctionDeclarationAfterType: false
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 2
UseTab: Never