-
Notifications
You must be signed in to change notification settings - Fork 1
/
.clang-format
146 lines (132 loc) · 3.8 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
# avr-libcpp
#
# Copyright 2020-2024, Andrew Countryman <[email protected]> and the avr-libcpp
# contributors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
# file except in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the specific language governing
# permissions and limitations under the License.
# Description: clang-format configuration.
Language: Cpp
Standard: c++17
BasedOnStyle: Google
DisableFormat: false
# general
BraceWrapping:
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: true
AfterNamespace: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
BreakBeforeBraces: Custom
ColumnLimit: 90
ContinuationIndentWidth: 4
DeriveLineEnding: false
IndentWidth: 4
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInParentheses: true
TabWidth: 4
UseCRLF: false
UseTab: Never
# preprocessor
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
ForEachMacros:
IncludeBlocks: Regroup
IncludeCategories:
IncludeIsMainRegex: ""
IncludeIsMainSourceRegex: ""
IndentPPDirectives: None
MacroBlockBegin: ""
MacroBlockEnd: ""
SortIncludes: true
# namespaces
CompactNamespaces: true
FixNamespaceComments: true
NamespaceIndentation: None
NamespaceMacros:
# templates
AlwaysBreakTemplateDeclarations: Yes
SpaceAfterTemplateKeyword: false
SpacesInAngles: false
# classes/structs
AccessModifierOffset: -2
AllowAllConstructorInitializersOnNextLine: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
TypenameMacros:
# function declarations/definitions
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakAfterReturnType: None
BinPackParameters: false
IndentWrappedFunctionNames: false
# function calls
AlignAfterOpenBracket: AlwaysBreak
AllowAllArgumentsOnNextLine: true
BinPackArguments: false
# declarations/expressions/statements
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignOperands: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
Cpp11BracedListStyle: false
DerivePointerAlignment: false
IndentCaseLabels: true
IndentGotoLabels: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PointerAlignment: Middle
RawStringFormats:
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: true
SpacesInSquareBrackets: true
StatementMacros:
# comments
AlignTrailingComments: true
CommentPragmas: ""
ReflowComments: true
SpacesBeforeTrailingComments: 1
# penalties
PenaltyBreakAssignment: 99
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakComment: 99
PenaltyBreakFirstLessLess: 99
PenaltyBreakString: 0
PenaltyBreakTemplateDeclaration: 0
PenaltyExcessCharacter: 1
PenaltyReturnTypeOnItsOwnLine: 99