-
Notifications
You must be signed in to change notification settings - Fork 434
Expand file tree
/
Copy path.clang-format
More file actions
85 lines (72 loc) · 2.02 KB
/
.clang-format
File metadata and controls
85 lines (72 loc) · 2.02 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
# SIPp clang-format configuration
# Based on existing code style patterns in the repository
Language: Cpp
Standard: c++17
# Base style - start from LLVM and customize
BasedOnStyle: LLVM
# Indentation
IndentWidth: 4
TabWidth: 4
UseTab: Never
IndentCaseLabels: false
IndentPPDirectives: None
NamespaceIndentation: None
# Braces - Allman/BSD style (braces on their own lines)
BreakBeforeBraces: Linux
# More granular control if needed:
# BraceWrapping:
# AfterClass: true
# AfterControlStatement: Always
# AfterEnum: true
# AfterFunction: true
# AfterNamespace: true
# AfterStruct: true
# AfterUnion: true
# BeforeCatch: true
# BeforeElse: true
# IndentBraces: false
# Line length
ColumnLimit: 120
# Pointer and reference alignment - attach to variable name
PointerAlignment: Right
ReferenceAlignment: Right
# e.g., char *ptr, int &ref
# Spacing
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
# Short statements
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
# Breaking
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakStringLiterals: true
# Arguments and parameters
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
BinPackArguments: true
BinPackParameters: true
# Includes
IncludeBlocks: Preserve
SortIncludes: false # Don't reorder includes - can break builds
# Other
FixNamespaceComments: true
MaxEmptyLinesToKeep: 2
ReflowComments: false # Don't reflow comments - can break formatting