|
| 1 | +--- |
| 2 | +Language: C |
| 3 | + |
| 4 | +# Indentation: tabs, one tab per indent level |
| 5 | +# The Emacs footer in source files specifies indent-tabs-mode: t |
| 6 | +UseTab: ForIndentation |
| 7 | +TabWidth: 4 |
| 8 | +IndentWidth: 4 |
| 9 | +ContinuationIndentWidth: 8 |
| 10 | +IndentCaseLabels: true |
| 11 | +IndentCaseBlocks: false |
| 12 | +IndentGotoLabels: false |
| 13 | +IndentPPDirectives: None |
| 14 | +IndentWrappedFunctionNames: false |
| 15 | + |
| 16 | +# Braces: Allman style - opening brace on its own line for everything |
| 17 | +BreakBeforeBraces: Allman |
| 18 | + |
| 19 | +# Alignment |
| 20 | +AlignAfterOpenBracket: DontAlign |
| 21 | +AlignConsecutiveAssignments: false |
| 22 | +AlignConsecutiveDeclarations: false |
| 23 | +AlignConsecutiveMacros: false |
| 24 | +AlignEscapedNewlines: Left |
| 25 | +AlignOperands: true |
| 26 | +AlignTrailingComments: true |
| 27 | + |
| 28 | +# Pointer style: mixed in codebase (char* ptr and char *ptr both appear), |
| 29 | +# derive per file with Left as default |
| 30 | +PointerAlignment: Left |
| 31 | +DerivePointerAlignment: true |
| 32 | + |
| 33 | +# Spaces |
| 34 | +SpaceAfterCStyleCast: false |
| 35 | +SpaceAfterLogicalNot: false |
| 36 | +SpaceBeforeAssignmentOperators: true |
| 37 | +SpaceBeforeParens: ControlStatements |
| 38 | +SpaceInEmptyBlock: false |
| 39 | +SpaceInEmptyParentheses: false |
| 40 | +SpacesInCStyleCastParentheses: false |
| 41 | +SpacesInParentheses: false |
| 42 | +SpacesInSquareBrackets: false |
| 43 | +SpacesBeforeTrailingComments: 1 |
| 44 | + |
| 45 | +# Line breaking |
| 46 | +ColumnLimit: 120 |
| 47 | +AllowAllArgumentsOnNextLine: true |
| 48 | +AllowAllParametersOfDeclarationOnNextLine: true |
| 49 | +AllowShortBlocksOnASingleLine: Never |
| 50 | +AllowShortCaseLabelsOnASingleLine: false |
| 51 | +AllowShortEnumsOnASingleLine: false |
| 52 | +AllowShortFunctionsOnASingleLine: None |
| 53 | +AllowShortIfStatementsOnASingleLine: Never |
| 54 | +AllowShortLoopsOnASingleLine: false |
| 55 | +AlwaysBreakAfterReturnType: None |
| 56 | +AlwaysBreakBeforeMultilineStrings: false |
| 57 | +BinPackArguments: true |
| 58 | +BinPackParameters: true |
| 59 | +BreakBeforeBinaryOperators: None |
| 60 | +BreakBeforeTernaryOperators: true |
| 61 | +BreakStringLiterals: true |
| 62 | + |
| 63 | +# Includes: preserve existing order, do not sort |
| 64 | +SortIncludes: Never |
| 65 | +IncludeBlocks: Preserve |
| 66 | + |
| 67 | +# Blank lines |
| 68 | +MaxEmptyLinesToKeep: 2 |
| 69 | + |
| 70 | +# Comments: do not reflow to preserve manual formatting |
| 71 | +ReflowComments: false |
| 72 | + |
| 73 | +# Penalties for line breaking decisions |
| 74 | +PenaltyBreakBeforeFirstCallParameter: 19 |
| 75 | +PenaltyBreakComment: 300 |
| 76 | +PenaltyBreakFirstLessLess: 120 |
| 77 | +PenaltyBreakString: 1000 |
| 78 | +PenaltyExcessCharacter: 1000000 |
| 79 | +PenaltyReturnTypeOnItsOwnLine: 60 |
0 commit comments