|
| 1 | +--- |
| 2 | +# Base Style |
| 3 | +BasedOnStyle: Google # Based on Google style guidelines |
| 4 | +Language: Cpp # Explicitly specify C++ |
| 5 | +Standard: c++17 # Use C++17 standard |
| 6 | + |
| 7 | +# Code Layout |
| 8 | +ColumnLimit: 180 # Recommended maximum line length |
| 9 | +IndentWidth: 4 # 4-space indentation |
| 10 | +InsertNewlineAtEOF: true # Ensure newline at end of file |
| 11 | +UseTab: Never # Exclusively use spaces for indentation |
| 12 | + |
| 13 | +# Code Structure |
| 14 | +AllowShortIfStatementsOnASingleLine: Never # Prevent single-line if statements |
| 15 | +AllowShortFunctionsOnASingleLine: Inline # Allow short functions on single line |
| 16 | +AllowShortLoopsOnASingleLine: false # Prevent single-line loops |
| 17 | +BinPackArguments: false |
| 18 | +BinPackParameters: OnePerLine |
| 19 | +BreakBeforeBraces: Attach # Attach braces to code block |
| 20 | +BreakBeforeBinaryOperators: NonAssignment # Break before non-assignment operators |
| 21 | +BreakBeforeTernaryOperators: true # Break before ternary operators |
| 22 | +BreakConstructorInitializers: BeforeColon # Break constructor initializers before colon |
| 23 | +BreakInheritanceList: BeforeColon # Break inheritance list before colon |
| 24 | +InsertBraces: true # Automatically insert braces for clarity |
| 25 | +PackConstructorInitializers: Never |
| 26 | + |
| 27 | +# Language Features |
| 28 | +AccessModifierOffset: -4 # Offset for access modifiers |
| 29 | +CompactNamespaces: false # Keep namespaces readable |
| 30 | +FixNamespaceComments: true # Properly format namespace comments |
| 31 | +IndentCaseLabels: true # Indent switch case labels |
| 32 | +NamespaceIndentation: All # Indent inside namespaces |
| 33 | + |
| 34 | +# Pointers and References |
| 35 | +DerivePointerAlignment: false # Manually set pointer alignment |
| 36 | +PointerAlignment: Left # Left-align pointers and references |
| 37 | + |
| 38 | +# Spacing and Alignment |
| 39 | +SpaceAroundPointerQualifiers: Default # Consistent space around pointer qualifiers |
| 40 | +SpaceBeforeParens: ControlStatements # Space before parentheses in control statements |
| 41 | +SpaceBeforeCtorInitializerColon: true # Space before constructor initializer colon |
| 42 | +SpaceBeforeInheritanceColon: true # Space before inheritance colon |
| 43 | +SpaceBeforeRangeBasedForLoopColon: true # Space before range-based for loop colon |
| 44 | +SpacesBeforeTrailingComments: 2 # Two spaces before trailing comments |
| 45 | +SpacesInContainerLiterals: false # No extra spaces in container literals |
| 46 | +SpacesInParensOptions: |
| 47 | + InEmptyParentheses: false # No spaces in empty parentheses |
| 48 | +SpacesInSquareBrackets: false # No extra spaces in square brackets |
| 49 | + |
| 50 | +# Comments and Includes |
| 51 | +AlignTrailingComments: |
| 52 | + Kind: Always # Strictly align trailing comments |
| 53 | +ReflowComments: true # Reflow comments to fit column limit |
| 54 | +SortIncludes: CaseSensitive # Sort includes in case-sensitive manner |
0 commit comments