-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
117 lines (109 loc) · 4.08 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
# Checkout config tool: https://zed0.co.uk/clang-format-configurator/
# Or http://cf.monofraps.net/
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# https://github.com/01org/parameter-framework/blob/master/.clang-format
#-----------------------------------------------------------------------------
# Common Settings
#-----------------------------------------------------------------------------
TabWidth: 2
IndentWidth: 2
ContinuationIndentWidth: 2
UseTab: Never
ColumnLimit: 140
Language: Cpp
#-----------------------------------------------------------------------------
# Align Settings
#-----------------------------------------------------------------------------
AlignAfterOpenBracket : Align
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlines: DontAlign
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
#-----------------------------------------------------------------------------
# Allow Settings
#-----------------------------------------------------------------------------
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
#-----------------------------------------------------------------------------
# Break Settings
#-----------------------------------------------------------------------------
BreakBeforeBraces: Allman
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
# BreakBeforeBinaryOperator: All
# BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: true
#-----------------------------------------------------------------------------
# Indent Settings
#-----------------------------------------------------------------------------
IndentCaseBlocks: false
IndentCaseLabels: true
NamespaceIndentation: All
IndentExternBlock: Indent
IndentPPDirectives: BeforeHash
# IndentRequires: false
IndentWrappedFunctionNames: false
#-----------------------------------------------------------------------------
# Spacing Settings
#-----------------------------------------------------------------------------
BitFieldColonSpacing: After
# EmptyLineBeforeAccessModifier: Always
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: true
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
#-----------------------------------------------------------------------------
# Penalty Settings
#-----------------------------------------------------------------------------
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
#-----------------------------------------------------------------------------
# Other Settings
#-----------------------------------------------------------------------------
CommentPragmas: "^ IWYU pragma:"
FixNamespaceComments: false
IncludeBlocks: Preserve
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PointerAlignment: Right
SortIncludes: true