forked from rticommunity/rticonnextdds-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
129 lines (98 loc) · 3.24 KB
/
.clang-format
File metadata and controls
129 lines (98 loc) · 3.24 KB
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
##############################################################
# RTI Conding Style
# -----------------
# for clang-format > 5.0
##############################################################
BasedOnStyle: WebKit
###############################################################
# Formatting rules in our coding conventions
###############################################################
# CFR1-01: 80-column line
Language: Cpp
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
# Unsupported
# CFR1-05: Function parameter formatting
AlignAfterOpenBracket: AlwaysBreak
AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakAfterReturnType: None
BinPackParameters: false
BinPackArguments: false
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
# CFR3-06: Pointer declaration
DerivePointerAlignment: false
PointerAlignment: Right
# Note that this won't work with references in C++
# CFR1-09: Casting
SpaceAfterCStyleCast: true
SpacesInCStyleCastParentheses: false
# CFR2-03: C classes
AlwaysBreakTemplateDeclarations: true
SpaceAfterTemplateKeyword: true
NamespaceIndentation: None
CompactNamespaces: false
FixNamespaceComments: true
# CFR2-10: Operators
BreakBeforeBinaryOperators: true
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
BraceWrapping:
AfterControlStatement: false
AfterEnum: false
# AfterExternBlock: false
AfterFunction: true # CFR3-02: Function definition
AfterNamespace: false # CFR2-03: C classes
AfterStruct: false
BeforeElse: false # CFR2-12: Else clause placement
AfterUnion: false
BeforeCatch: false
IndentBraces: false
# 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
BreakStringLiterals: true
IndentWrappedFunctionNames: true
# This one is interesting
MaxEmptyLinesToKeep: 2
Cpp11BracedListStyle: false
#ExperimentalAutoDetectBinPacking: true