-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
138 lines (120 loc) · 3.57 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
# Always prefer densely packed code...
# Nearly every option is set (except penalty values).
# See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
Language: Cpp
Standard: c++20
DeriveLineEnding: true
# Most important options
ColumnLimit: 120
IndentWidth: 2
TabWidth: 2
UseTab: Never
BreakBeforeBraces: Attach
# Indentations
AccessModifierOffset: -2
IndentAccessModifiers: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 2
PPIndentWidth: 2
NamespaceIndentation: All
IndentCaseLabels: true
IndentCaseBlocks: false
IndentExternBlock: Indent
IndentGotoLabels: false
IndentPPDirectives: AfterHash
IndentWrappedFunctionNames: false
IndentRequiresClause: false
# Line break points
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackArguments: false
BinPackParameters: false
PackConstructorInitializers: Never
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
RequiresClausePosition: WithPreceding
AttributeMacros: []
StatementMacros: []
# Empty lines
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
EmptyLineBeforeAccessModifier: Leave
EmptyLineAfterAccessModifier: Leave
SeparateDefinitionBlocks: Leave
# One-liners
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
CompactNamespaces: false
RemoveBracesLLVM: false
# Spaces
DerivePointerAlignment: false
PointerAlignment: Left
ReferenceAlignment: Left
SpaceAroundPointerQualifiers: Default
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
Cpp11BracedListStyle: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeRangeBasedForLoopColon: false
BitFieldColonSpacing: After
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterOverloadedOperator: false
AfterRequiresInClause: true
AfterRequiresInExpression: true
BeforeNonEmptyParentheses: false
SpaceBeforeSquareBrackets: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
# Auto align
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
# Include directives
SortUsingDeclarations: false
SortIncludes: CaseInsensitive
IncludeBlocks: Merge
IncludeCategories:
- Regex: '<[[:alpha:]_]+>'
Priority: 1
- Regex: '<.*>'
Priority: 2
- Regex: '.*'
Priority: 4
IncludeIsMainRegex: '$'
# Comments
SpacesBeforeTrailingComments: 1
CommentPragmas: '^ NOLINT'
ReflowComments: true
FixNamespaceComments: false