-
Notifications
You must be signed in to change notification settings - Fork 7
/
.clang-format
85 lines (64 loc) · 2.25 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
---
BasedOnStyle: LLVM
IndentWidth: 4
---
Language: Cpp
Standard: Cpp11
ColumnLimit: 120
BreakBeforeBraces: Linux
PointerAlignment: Right
AlignAfterOpenBracket: AlwaysBreak
AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: NonAssignment
AlignArrayOfStructures: Left
# format C++11 braced lists like function calls
Cpp11BracedListStyle: true
# do not put a space before C++11 braced lists
SpaceBeforeCpp11BracedList: false
# no namespace indentation to keep indent level low
NamespaceIndentation: None
# we use template< without space.
SpaceAfterTemplateKeyword: false
# Always break after template declaration
AlwaysBreakTemplateDeclarations: true
# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
# keep lambda formatting multi-line if not empty
AllowShortLambdasOnASingleLine: Empty
# return types should not be on their own lines
AlwaysBreakAfterReturnType: None
PenaltyReturnTypeOnItsOwnLine: 1000
AlwaysBreakAfterDefinitionReturnType: None
# Break constructor initializers before the colon and after the commas,
# and never put the all in one line.
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
PackConstructorInitializers: Never
# Place ternary operators after line breaks
BreakBeforeTernaryOperators: true
# No own indentation level for access modifiers
IndentAccessModifiers: false
AccessModifierOffset: -4
# Add empty line only when access modifier starts a new logical block.
EmptyLineBeforeAccessModifier: LogicalBlock
# Only merge empty functions.
AllowShortFunctionsOnASingleLine: Empty
# Don't indent case labels.
IndentCaseLabels: false
# No space after C-style cast
SpaceAfterCStyleCast: false
# Never pack arguments or parameters
BinPackArguments: false
BinPackParameters: false
# Avoid breaking around an assignment operator
PenaltyBreakAssignment: 150
# Left-align newline escapes, e.g. in macros
AlignEscapedNewlines: Left
# Enums should be one entry per line
AllowShortEnumsOnASingleLine: false
# we want consecutive macros to be aligned
AlignConsecutiveMacros: true
# never sort includes, only regroup (in rare cases)
IncludeBlocks: Regroup
SortIncludes: Never