-
-
Notifications
You must be signed in to change notification settings - Fork 101
/
.clang-format
156 lines (153 loc) · 7.03 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
# created by qo0 for clang-format 15.0.2 version #
# alphabetically aranged (except global options) #
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html #
# global options
DisableFormat: false
BasedOnStyle: Microsoft
Language: Cpp
Standard: c++20
# @todo: remove variables that equal defaults
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign # @test: use false # @note: when set to 'DontAlign', dependent on 'ContinuationIndentWidth'
AlignArrayOfStructures: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: None
AlignEscapedNewlines: Left
AlignOperands: DontAlign # @test: use false # @note: when set to 'DontAlign', dependent on 'ContinuationIndentWidth'; when set to 'AlignAfterOperator', dependent on 'BreakBeforeBinaryOperators'
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false # @note: ignores 'BinPackArguments'
AllowAllParametersOfDeclarationOnNextLine: false # @note: ignores 'BinPackArguments'
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None # @note: when set to 'None', dependent on 'PenaltyReturnTypeOnItsOwnLine'
AlwaysBreakBeforeMultilineStrings: false # @note: if true, dependent on 'ContinuationIndentWidth'
#AlwaysBreakTemplateDeclarations: Yes # @test: to make it work correctly with 'RequiresClausePosition' leave it unspecified # @note: when set to 'No', dependent on 'PenaltyBreakTemplateDeclaration'
#AttributeMacros: # @todo: tweak
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false # @note: dependent on 'AfterFunction' and 'AllowShortFunctionsOnASingleLine'
SplitEmptyRecord: false # @note: dependent on 'AfterClass'
SplitEmptyNamespace: true # @note: dependent on 'AfterNamespace'
#BreakAfterAttributes: Never # @todo: clan-format 16
#BreakArrays: false # @todo: clang-format 16 # @note: supported only for JSON
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom # @note: when set to 'Custom', dependent on 'BraceWrapping'
BreakBeforeConceptDeclarations: Never
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
#BreakInheritanceList: AfterComma # @note: to disable this, only leaving it unspecified works
BreakStringLiterals: false
ColumnLimit: 0
CompactNamespaces: false # @test: what if i gonna use nested namespaces like Foo::Bar?
#ConstructorInitializerIndentWidth: 0 # @test: tweak
ContinuationIndentWidth: 0
Cpp11BracedListStyle: false
DerivePointerAlignment: false # @note: if true, 'PointerAlignment' is only used as a fallback if none can be derived
EmptyLineAfterAccessModifier: Never # @note: when set to 'Leave' or 'Always', dependent on 'MaxEmptyLinesToKeep'
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: false # @note: if true, dependent on 'ShortNamespaceLines'
IncludeBlocks: Regroup # @note: when set to 'Regroup', dependent on 'IncludeCategories'
#IncludeCategories: # @todo: tweak
#IncludeIsMainRegex: # @todo: tweak
IndentAccessModifiers: false # @note: if false, dependent on 'AccessModifierOffset'; if true, ignores 'AccessModifierOffset'
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: AfterExternBlock # @note: when set to 'AfterExternBlock', dependent on 'BraceWrapping.AfterExternBlock'
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: false # @note: if true, dependent on 'RequiresClausePosition'
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: false
InsertTrailingCommas: None # @note: when set to 'Wrapped', conflicts with 'BinPackArguments'
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
#LineEnding: LF # @todo: clang-format 16
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PPIndentWidth: -1 # @note: when set to '-1', dependent on 'IndentWidth'
PackConstructorInitializers: NextLine # @todo: after clang-format 16 set this to 'NextLineOnly'
# @test: tweak
# ---
PenaltyBreakAssignment: 0
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakComment: 0
PenaltyBreakFirstLessLess: 0
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 0
PenaltyBreakTemplateDeclaration: 0
PenaltyExcessCharacter: 0
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 0
# ---
PointerAlignment: Left
QualifierAlignment: Custom # @note: when set to 'Custom', dependent on 'QualifierOrder'; warning! setting this option to something other than 'Leave' could lead to incorrect code formatting
QualifierOrder: ['inline', 'static', 'constexpr', 'const', 'volatile', 'type', 'restrict']
ReferenceAlignment: Pointer # @note: when set to 'Pointer', dependent on 'PointerAlignment'
ReflowComments: false
#RemoveSemicolon: false # @todo: clang-format 16 # @note: warning! setting this option to true could lead to incorrect code formatting
RequiresClausePosition: WithPreceding # @test: this doesn't seem to work correctly when 'AlwaysBreakTemplateDeclarations' is set
#RequiresExpressionIndentation: OuterScope # @todo: clang-format 16
SeparateDefinitionBlocks: Always # @todo: use 'Leave'?
ShortNamespaceLines: 0
SortIncludes: Never # @test: CaseInsensitive
SortUsingDeclarations: true # @todo: after clang-format 16 change to 'Lexicographic'
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default # @note: when set to 'Default', dependent on 'PointerAlignment'
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Custom # @note: when set to 'Custom', dependent on 'SpaceBeforeParensOptions'
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: false
AfterFunctionDeclarationName: false
AfterIfMacros: false
AfterOverloadedOperator: false
AfterRequiresInClause: true
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: true # @todo: this doesn't work for braced initilization for some reason
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1 # @test: tweak
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix: # @note: dependent on 'ReflowComments'
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
#TabWidth: # @todo: tweak or leave it as it is
UseCRLF: false # @todo: remove after clang-format 16
UseTab: Always # @todo: tweak
#WhitespaceSensitiveMacros: # @todo: tweak