-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy path.clang-format
More file actions
87 lines (75 loc) · 2.47 KB
/
Copy path.clang-format
File metadata and controls
87 lines (75 loc) · 2.47 KB
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
BasedOnStyle: Google
ColumnLimit: 160
IndentWidth: 4
# Indentation and Alignment
# -------------------------
# This will make access modifiers (public/protected/private) sit on the same indentation as `class` keyword
AccessModifierOffset: -4
# Arguments, parameters and construction initializer are broken as following:
# - Try to fit everything into single line (controlled by ColumnLimit).
# - If it doesn't fit, break immediately after open bracket (in case of arguments and parameters)
# or after colon in case of constructor initializers.
# - Try to fit everything else into the second line.
# - If it doesn't fit in second line, then each argument, parameter or initializer will sit in its own line.
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveMacros: Consecutive
AlignTrailingComments: true
AlignEscapedNewlines: Left
AlignOperands: true
# Bin Packing
# -----------
BinPackArguments: false
BinPackParameters: false
# Constructor Initializers
# ------------------------
# When constructor initializers exist in the constructor definition, leave the colon as last thing on the original
# line instead of putting it on the next line.
BreakConstructorInitializers: AfterColon
# Pointer and Reference Alignment
# -------------------------------
DerivePointerAlignment: true
PointerAlignment: Left
ReferenceAlignment: Left
# Braces and Blocks
# -----------------
# Disallow single statements after if/else/for/while/do without curly braces.
InsertBraces: true
BreakBeforeBraces: Allman
# Separate definition blocks, including classes, structs, enums, and functions.
SeparateDefinitionBlocks: Always
SpaceBeforeCpp11BracedList: true
# Spaces and Formatting
# ---------------------
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
# Short Statements and Functions
# ------------------------------
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
# Miscellaneous
# -------------
RemoveSemicolon: true
SortUsingDeclarations: LexicographicNumeric
# Include Categories
# ------------------
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
- Regex: '^<.*>'
Priority: 2
SortPriority: 0
- Regex: '^".*"'
Priority: 3
SortPriority: 0
# Custom Macros
# -------------
# Add custom macros for v_if and v_elseif
ForEachMacros:
- v_if
- v_elseif