forked from rticommunity/rticonnextdds-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
146 lines (114 loc) · 3.82 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
##############################################################
# RTI Coding Style
# -----------------
# for clang-format > 9.0
##############################################################
BasedOnStyle: WebKit
###############################################################
# Formatting rules in our coding conventions
###############################################################
# CFR1-01: 80-column line
ColumnLimit: 80
# CFR1-02: Tab character
TabWidth: 8
UseTab: Never
# CFR1-03: Horizontal alignment
IndentWidth: 4
ContinuationIndentWidth: 8
# CFR1-04: Nested macro definitions are nested two spaces
IndentPPDirectives: BeforeHash
# CFR1-05: Function parameter formatting
AlignAfterOpenBracket: AlwaysBreak
AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine: false
AlwaysBreakAfterReturnType: None
BinPackParameters: false
BinPackArguments: false
PenaltyReturnTypeOnItsOwnLine: 9999
#ExperimentalAutoDetectBinPacking: false
# CFR1-06: Comments
AlignTrailingComments: true
PenaltyBreakComment: 1
ReflowComments: true
SpacesBeforeTrailingComments: 2
# Many other features are unsupported
# CFR1-07: End-of-line character
# Unsupported
# CFR1-08: Pointer declarations
DerivePointerAlignment: false
PointerAlignment: Right
# Note that this won't work with references in C++ and function return
# declarations
# CFR1-09: Casting
SpaceAfterCStyleCast: true
SpacesInCStyleCastParentheses: false
# CFR2-03: C classes
AlwaysBreakTemplateDeclarations: true
SpaceAfterTemplateKeyword: true
NamespaceIndentation: None
CompactNamespaces: true
FixNamespaceComments: true
# CFR2-10: Operators
BreakBeforeTernaryOperators: true
SpaceBeforeAssignmentOperators: true
# CFR2-11: Control statements
SpaceBeforeParens: ControlStatements
# CFR2-15 Switch statement
IndentCaseLabels: false
AllowShortCaseLabelsOnASingleLine: false
# CFR3-02: Function definition
KeepEmptyLinesAtTheStartOfBlocks: false
# CFR3-05: Statements
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
# CFR3-06: Pointer declaration
# Checkout CFR1-08
BreakBeforeBraces: Custom
BraceWrapping:
# AfterCaseLabel
AfterClass: false # CFR2-03: C classes
AfterControlStatement: false # CFR2-11: Control statements
AfterEnum: false # CFR3-04: Use of typedef
AfterFunction: true # CFR3-02: Function definition
AfterNamespace: false # CFR2-03: C classes
# AfterObjCDeclaration
AfterStruct: false # CFR3-04: Use of typedef
AfterUnion: false
# AfterExternBlock: false
BeforeCatch: false
BeforeElse: false # CFR2-12: Else clause placement
IndentBraces: false # CFR3-02: Function definition
# These ones I don't know... I would set them to false
# SplitEmptyFunction: false
# SplitEmptyRecord: false
# SplitEmptyNamespace: false
###############################################################
# Formatting rules currently not in our coding conventions
###############################################################
AlignEscapedNewlines: Left
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
# C++ Inheritance and constructor initialization
# Needs to be added to conding conventions
BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: false
BreakBeforeInheritanceComma: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
SpaceAfterTemplateKeyword: false
BreakStringLiterals: true
IndentWrappedFunctionNames: false
# This one is interesting
MaxEmptyLinesToKeep: 2
Cpp11BracedListStyle: false
BreakBeforeBinaryOperators: NonAssignment
# Do not sort include files, it breaks the build. Some includes need to appear
# at the beginning
SortIncludes: false
---
Language: Cpp
---
Language: Java
---
Language: CSharp