-
Notifications
You must be signed in to change notification settings - Fork 15
/
.clang-format
75 lines (59 loc) · 1.86 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
Standard: c++17
# Indent with a certain number of spaces at a time (no tabs).
IndentWidth: 4
# Keep lines under a certain number of columns long.
ColumnLimit: 120
# Always break before braces
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
AfterExternBlock: false # Keeps extern "C" blocks unindented.
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: BeforeColon
PackConstructorInitializers: CurrentLine
# Indent case labels.
IndentCaseLabels: true
# Right-align pointers and references
PointerAlignment: Left
# Align things as much as possible.
AlignOperands: true
AlignConsecutiveAssignments: Consecutive
AlignEscapedNewlines: Left
AlignTrailingComments: true
BinPackArguments: false
BinPackParameters: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: InlineOnly
# Use N space negative offset for access modifiers
AccessModifierOffset: -4
AllowShortCaseLabelsOnASingleLine: false
# Useful for spacing out functions in classes
KeepEmptyLinesAtTheStartOfBlocks: true
# Indent nested PP directives.
IndentPPDirectives: BeforeHash
# Preserve include blocks
IncludeBlocks: Regroup
IncludeCategories:
# By default, first include the 'main' header file related to source file
# Then include every 'system' headers (i.e. in <>)
- Regex: '<[^Q][[:alnum:]_]+(\.h)?>'
Priority: 10
# Then include '3rd party' headers
- Regex: '<[[:alnum:]/._]+>'
Priority: 20
# And finally, include every 'project' header
- Regex: '.*'
Priority: 30