-
Notifications
You must be signed in to change notification settings - Fork 1
/
.clang-format
88 lines (88 loc) · 2.78 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
76
77
78
79
80
81
82
83
84
85
86
87
88
---
Language: Cpp
# Access specifiers are best unindented, to keep them easy to spot:
AccessModifierOffset: -4
# Keep them together. Would be preferable to put all arguments on a new line
AlignAfterOpenBracket: true
# Newline escapes should be aligned, they're prettier that way
AlignEscapedNewlinesLeft: false
# Same with OpenBracket alignment. No need for that.
AlignOperands: false
AlignTrailingComments: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakTemplateDeclarations: true
# Readability:
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BinPackParameters: false
BinPackArguments: false
# Not a hard and fast rule, but yeah
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
DerivePointerAlignment: false
IndentCaseLabels: false
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: true
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: 600
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 4
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: "^ IWYU pragma:"
SpaceBeforeParens: ControlStatements
DisableFormat: false
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '"\.' # Relative headers
Priority: 10
- Regex: '<amongoc/|"amongoc/' # amongoc headers first
Priority: 20
- Regex: '<bson/|"bson/' # bson headers next
Priority: 25
- Regex: '<mlib/|"mlib/' # mlib headers next
Priority: 30
- Regex: '<.*/.*\.h>|<.*/.*\.hpp>' # Other non-standard headres
Priority: 40
- Regex: '<.*\.h>|<.*\.hpp>' # Other non-standard headres
Priority: 50
- Regex: '<[[:alnum:]_.]+>|<std.*\.h>' # Standard headres
Priority: 60
InsertNewlineAtEOF: true
IfMacros:
- mlib_math_catch
AllowBreakBeforeNoexceptSpecifier: Always
---
# For some reason, Clang sees some files as Objective-C. Add this section just to appease it.
Language: ObjC