Skip to content

Commit 4a38b7e

Browse files
committed
Fix
1 parent 58585d3 commit 4a38b7e

File tree

1 file changed

+67
-3
lines changed

1 file changed

+67
-3
lines changed

.clang-format

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,75 @@
11
---
2-
BasedOnStyle: LLVM
2+
# Explicitly define all formatting options to ensure consistency across clang-format versions
33
Language: Cpp
4+
# Don't base on any style to avoid version-specific behaviors
5+
# BasedOnStyle: LLVM
46

7+
# Indentation
58
UseTab: Never
69
IndentWidth: 2
10+
TabWidth: 2
11+
BreakBeforeBraces: Attach
12+
IndentCaseLabels: false
13+
NamespaceIndentation: None
14+
ContinuationIndentWidth: 2
15+
IndentPPDirectives: None
16+
IndentWrappedFunctionNames: false
17+
AccessModifierOffset: -2
18+
19+
# Alignment
20+
AlignAfterOpenBracket: DontAlign
21+
AlignConsecutiveAssignments: false
22+
AlignConsecutiveDeclarations: false
23+
AlignConsecutiveMacros: false
24+
AlignEscapedNewlines: Left
25+
AlignOperands: false
26+
AlignTrailingComments: true
27+
DerivePointerAlignment: false
28+
PointerAlignment: Right
29+
30+
# Wrapping and Breaking
731
ColumnLimit: 0
8-
SortIncludes: Never
32+
AllowAllParametersOfDeclarationOnNextLine: false
33+
AllowShortBlocksOnASingleLine: Never
34+
AllowShortCaseLabelsOnASingleLine: false
35+
AllowShortFunctionsOnASingleLine: All
36+
AllowShortIfStatementsOnASingleLine: Always
37+
AllowShortLoopsOnASingleLine: false
38+
AlwaysBreakAfterReturnType: None
39+
AlwaysBreakBeforeMultilineStrings: false
40+
AlwaysBreakTemplateDeclarations: No
41+
BinPackArguments: false
42+
BinPackParameters: false
43+
BreakBeforeBinaryOperators: None
44+
BreakBeforeTernaryOperators: false
45+
BreakConstructorInitializers: BeforeColon
46+
BreakInheritanceList: BeforeColon
47+
BreakStringLiterals: false
48+
CompactNamespaces: false
49+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
950
Cpp11BracedListStyle: false
51+
ReflowComments: false
52+
SortIncludes: Never
53+
54+
# The one rule we want to enable
1055
SpaceAfterCStyleCast: true
11-
AllowShortIfStatementsOnASingleLine: Always
56+
57+
# Other Spaces
58+
SpaceAfterLogicalNot: false
59+
SpaceAfterTemplateKeyword: true
60+
SpaceBeforeAssignmentOperators: true
61+
SpaceBeforeCpp11BracedList: true
62+
SpaceBeforeCtorInitializerColon: true
63+
SpaceBeforeInheritanceColon: true
64+
SpaceBeforeParens: ControlStatements
65+
SpaceBeforeRangeBasedForLoopColon: true
66+
SpaceBeforeSquareBrackets: false
67+
SpaceInEmptyBlock: false
68+
SpaceInEmptyParentheses: false
69+
SpacesBeforeTrailingComments: 1
70+
SpacesInAngles: false
71+
SpacesInCStyleCastParentheses: false
72+
SpacesInConditionalStatement: false
73+
SpacesInContainerLiterals: true
74+
SpacesInParentheses: false
75+
SpacesInSquareBrackets: false

0 commit comments

Comments
 (0)