-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
104 lines (93 loc) · 2.49 KB
/
Copy path.clang-format
File metadata and controls
104 lines (93 loc) · 2.49 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Opus Trade Bot - Clang Format Configuration
# Based on Google C++ Style Guide with HFT-specific modifications
Language: Cpp
Standard: c++20
BasedOnStyle: Google
# Indentation
IndentWidth: 4
TabWidth: 4
UseTab: Never
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
NamespaceIndentation: None
# Braces
BreakBeforeBraces: Attach
Cpp11BracedListStyle: true
InsertBraces: true
# Line Length
ColumnLimit: 100
# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
# Line Breaks
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
# Spaces
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Includes
IncludeBlocks: Regroup
IncludeCategories:
# Project headers
- Regex: '^"opus/'
Priority: 1
# Third-party headers
- Regex: '^<(boost|simdjson|spdlog|absl)/'
Priority: 2
# System headers
- Regex: '^<[a-z_]+>'
Priority: 3
# Other
- Regex: '.*'
Priority: 4
SortIncludes: CaseSensitive
# Misc
FixNamespaceComments: true
MaxEmptyLinesToKeep: 1
PointerAlignment: Left
ReflowComments: true
SortUsingDeclarations: true
# Keep short accessors short
AccessModifierOffset: -4
EmptyLineBeforeAccessModifier: Always
EmptyLineAfterAccessModifier: Never
# Penalties
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200