-
Notifications
You must be signed in to change notification settings - Fork 1
/
.clang-format
executable file
·122 lines (106 loc) · 4.26 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# A .clang-format file to adhere to the Google C++ style guide
# - Google C++ Style Guide: https://google.github.io/styleguide/cppguide.html
# - CLANG-FORMAT STYLE OPTIONS: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
# Author: Munseong Jeong <[email protected]>
BasedOnStyle: Google
Language: Cpp
Standard: c++14
Cpp11BracedListStyle: true
DerivePointerAlignment: false
IndentCaseLabels: true
PointerAlignment: Left
AlignConsecutiveAssignments: None
AlignOperands: DontAlign
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: All
AllowShortCaseLabelsOnASingleLine: false
BreakBeforeBinaryOperators: None
# BreakTemplateDeclarations: Yes
AlwaysBreakTemplateDeclarations: Yes
EmptyLineBeforeAccessModifier: LogicalBlock
IncludeBlocks: Preserve # to sort after getting help from cpplint
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
SeparateDefinitionBlocks: Leave
QualifierAlignment: Custom
QualifierOrder: ['friend', 'inline', 'static', 'constexpr', 'const', 'volatile', 'type', 'restrict']
# https://github.com/google/googletest/blob/9d43b27f7a873596496a2ea70721b3f9eb82df01/googletest/test/googletest-filepath-test.cc#L398
IndentPPDirectives: None
# https://github.com/google/googletest/blob/9d43b27f7a873596496a2ea70721b3f9eb82df01/googletest/samples/sample8_unittest.cc#L53
BreakBeforeTernaryOperators: true
# https://github.com/google/googletest/blob/9d43b27f7a873596496a2ea70721b3f9eb82df01/googlemock/test/gmock-function-mocker_test.cc#L822
AllowShortLambdasOnASingleLine: Inline
# https://google.github.io/styleguide/cppguide.html#Constructor_Initializer_Lists
PackConstructorInitializers: NextLine
# https://google.github.io/styleguide/cppguide.html#Line_Length
ColumnLimit: 80
IndentWidth: 2
ContinuationIndentWidth: 4
ReflowComments: true
# https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs
TabWidth: 2
UseTab: Never
# https://google.github.io/styleguide/cppguide.html#Class_Format
AccessModifierOffset: -1 # IntentWidth - 1
# https://google.github.io/styleguide/cppguide.html#Namespace_Formatting
CompactNamespaces: false
FixNamespaceComments: true
NamespaceIndentation: None
ShortNamespaceLines: 0
# https://google.github.io/styleguide/cppguide.html#Constructor_Initializer_Lists
BreakConstructorInitializers: BeforeColon
# https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
# https://github.com/google/googletest/blob/9d43b27f7a873596496a2ea70721b3f9eb82df01/googlemock/include/gmock/gmock-nice-strict.h#L171
# https://github.com/google/googletest/blob/9d43b27f7a873596496a2ea70721b3f9eb82df01/googlemock/test/gmock-more-actions_test.cc#L266
# https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
AlignAfterOpenBracket: Align
# AlignAfterOpenBracket: DontAlign
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackArguments: false
BinPackParameters: false
# Munseong: We don't need to address this case, because we only use c++ syntax(e.g., static_cast<T>)
# SpaceAfterCStyleCast: true # (int) i;
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptControlMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2 # } // namespace blahblah
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInSquareBrackets: false
SpacesInParensOptions:
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
Other: false
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html#bracewrapping
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false