|
1 | 1 | --- |
2 | | -BasedOnStyle: LLVM |
| 2 | +# Explicitly define all formatting options to ensure consistency across clang-format versions |
3 | 3 | Language: Cpp |
| 4 | +# Don't base on any style to avoid version-specific behaviors |
| 5 | +# BasedOnStyle: LLVM |
4 | 6 |
|
| 7 | +# Indentation |
5 | 8 | UseTab: Never |
6 | 9 | 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 |
7 | 31 | 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 |
9 | 50 | Cpp11BracedListStyle: false |
| 51 | +ReflowComments: false |
| 52 | +SortIncludes: Never |
| 53 | + |
| 54 | +# The one rule we want to enable |
10 | 55 | 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