-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.clang-format
More file actions
50 lines (39 loc) · 1.57 KB
/
.clang-format
File metadata and controls
50 lines (39 loc) · 1.57 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
# Align consecutive declarations and assignments
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
# Aligns function parameters and arguments when wrapping to a new line
AlignAfterOpenBracket: Align
BinPackArguments: false
BinPackParameters: false
# Column limit to trigger line wrapping
# ColumnLimit: 160 # Adjust as needed; lower value ensures more wrapping
IndentWidth: 4
TabWidth: 4
UseTab: Never # Ensures spaces are used instead of tabs
# Break function declarations and calls over multiple lines if they exceed the ColumnLimit
AllowAllParametersOfDeclarationOnNextLine: false
# AllowShortFunctionsOnASingleLine: None
AlwaysBreakAfterReturnType: None
BreakConstructorInitializers: BeforeComma
PenaltyBreakBeforeFirstCallParameter: 0
# Formatting and alignment for readability
PointerAlignment: Left
AlignTrailingComments: true
SpaceBeforeParens: ControlStatements
# SpacesInParens: true
# Brace wrapping options
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
SplitEmptyFunction: true
SplitEmptyRecord: true
IndentCaseLabels: true
# Other convinient flags same than previous clang-format
SpaceBeforeCpp11BracedList: true
AccessModifierOffset: -4 # public, private, protected will be aligned with braces
SpacesInParentheses: true
ColumnLimit: 0 # Using around 120 would allow to split vertically 2 files, fitting in width ( also when merging conflicts comparing side by side ) but probably better to pick unlimited
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: All