-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
99 lines (85 loc) · 2.34 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
---
# Docs: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Base style and language specification
BasedOnStyle: LLVM
Language: Cpp
# Pointer and reference alignment
DerivePointerAlignment: false
PointerAlignment: Left
ReferenceAlignment: Right
# Indentation
IndentWidth: 4
IndentCaseLabels: true
IndentCaseBlocks: true
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 10
IndentPPDirectives: BeforeHash
PPIndentWidth: 4
# Single-line
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
# Namespace formatting
NamespaceIndentation: All
CompactNamespaces: false
FixNamespaceComments: true
# Alignment
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveAssignments:
Enabled: false
AcrossComments: true
AlignCompound: true
AlignConsecutiveDeclarations:
Enabled: false
AcrossComments: true
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: true
AcrossComments: true
AlignEscapedNewlines: DontAlign
MaxEmptyLinesToKeep: 1
AlignTrailingComments:
Kind: Never
OverEmptyLines: 0 # Is set to 1 is MaxEmptyLinesToKeep is 2
# Spacing
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Before
SpaceBeforeAssignmentOperators: true
SpacesInAngles: Never
# Control structure formatting
BraceWrapping:
AfterClass: false
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
# Breaking settings
BreakBeforeBinaryOperators: true
AlwaysBreakBeforeMultilineStrings: false
# Parameter and argument packing
BinPackParameters: false
BinPackArguments: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
# Comma insertion
InsertTrailingCommas: Wrapped
# Miscellaneous insertions
InsertBraces: true # Warn: Setting this option to true could break code
InsertNewlineAtEOF: true
SeparateDefinitionBlocks: Always
# Line width and wrapping
ColumnLimit: 79
# Commented out options (for version compatibility or preference)
# BracedInitializerIndentWidth: 4 # Requires clang-format version 17 or higher
...