1+ # Google C/C++ Code Style settings (with 4-space)
2+ # Refered to https://github.com/kehanXue/google-style-clang-format/blob/master/.clang-format
3+
4+ Language : Cpp
5+ BasedOnStyle : Google
6+ AccessModifierOffset : -1
7+ AlignAfterOpenBracket : Align
8+ AlignConsecutiveAssignments : None
9+ AlignOperands : Align
10+ AllowAllArgumentsOnNextLine : true
11+ AllowAllConstructorInitializersOnNextLine : true
12+ AllowAllParametersOfDeclarationOnNextLine : false
13+ AllowShortBlocksOnASingleLine : Empty
14+ AllowShortCaseLabelsOnASingleLine : false
15+ AllowShortFunctionsOnASingleLine : Inline
16+ AllowShortIfStatementsOnASingleLine : Never # To avoid conflict, set this "Never" and each "if statement" should include brace when coding
17+ AllowShortLambdasOnASingleLine : Inline
18+ AllowShortLoopsOnASingleLine : false
19+ AlwaysBreakAfterReturnType : None
20+ AlwaysBreakTemplateDeclarations : Yes
21+ BinPackArguments : true
22+ BreakBeforeBraces : Custom
23+ BraceWrapping :
24+ AfterCaseLabel : false
25+ AfterClass : false
26+ AfterStruct : false
27+ AfterControlStatement : Never
28+ AfterEnum : false
29+ AfterFunction : false
30+ AfterNamespace : false
31+ AfterUnion : false
32+ AfterExternBlock : false
33+ BeforeCatch : false
34+ BeforeElse : false
35+ BeforeLambdaBody : false
36+ IndentBraces : false
37+ SplitEmptyFunction : false
38+ SplitEmptyRecord : false
39+ SplitEmptyNamespace : false
40+ BreakBeforeBinaryOperators : None
41+ BreakBeforeTernaryOperators : true
42+ BreakConstructorInitializers : BeforeColon
43+ BreakInheritanceList : BeforeColon
44+ ColumnLimit : 120
45+ CompactNamespaces : false
46+ ContinuationIndentWidth : 8
47+ Cpp11BracedListStyle : true
48+ DerivePointerAlignment : false # Make sure the * or & align on the left
49+ EmptyLineBeforeAccessModifier : LogicalBlock
50+ FixNamespaceComments : true
51+ IncludeBlocks : Preserve
52+ IndentCaseLabels : true
53+ IndentPPDirectives : None
54+ IndentWidth : 4
55+ KeepEmptyLinesAtTheStartOfBlocks : true
56+ MaxEmptyLinesToKeep : 1
57+ NamespaceIndentation : None
58+ ObjCSpaceAfterProperty : false
59+ ObjCSpaceBeforeProtocolList : true
60+ PointerAlignment : Left
61+ ReflowComments : false
62+ # SeparateDefinitionBlocks: Always # Only support since clang-format 14
63+ SpaceAfterCStyleCast : false
64+ SpaceAfterLogicalNot : false
65+ SpaceAfterTemplateKeyword : true
66+ SpaceBeforeAssignmentOperators : true
67+ SpaceBeforeCpp11BracedList : false
68+ SpaceBeforeCtorInitializerColon : true
69+ SpaceBeforeInheritanceColon : true
70+ SpaceBeforeParens : ControlStatements
71+ SpaceBeforeRangeBasedForLoopColon : true
72+ SpaceBeforeSquareBrackets : false
73+ SpaceInEmptyParentheses : false
74+ SpacesBeforeTrailingComments : 2
75+ SpacesInAngles : false
76+ SpacesInCStyleCastParentheses : false
77+ SpacesInContainerLiterals : false
78+ SpacesInParentheses : false
79+ SpacesInSquareBrackets : false
80+ Standard : c++11
81+ TabWidth : 8
82+ UseTab : Never
0 commit comments