| 1 |
BasedOnStyle: LLVM |
| 2 |
|
| 3 |
# Indentation |
| 4 |
IndentWidth: 4 |
| 5 |
TabWidth: 4 |
| 6 |
UseTab: Never |
| 7 |
IndentCaseLabels: true |
| 8 |
|
| 9 |
# Line length |
| 10 |
ColumnLimit: 160 |
| 11 |
# Dont join function args/params that are manually split into lines even if they fit |
| 12 |
BinPackArguments: false |
| 13 |
BinPackParameters: false |
| 14 |
|
| 15 |
# Return type on its own line for definitions; forward declarations stay on one line: |
| 16 |
# static void |
| 17 |
# foo(...) { |
| 18 |
BreakAfterReturnType: AllDefinitions |
| 19 |
|
| 20 |
# Brace style: K&R — opening brace on same line as function params / control flow |
| 21 |
BreakBeforeBraces: Attach |
| 22 |
|
| 23 |
# Pointer: star next to variable name (char *p, PyObject *src) |
| 24 |
# Note: standalone return-type lines in the code use PyObject* (left style) but |
| 25 |
# that is the minority case; Right is dominant for parameters and local variables. |
| 26 |
PointerAlignment: Right |
| 27 |
DerivePointerAlignment: false |
| 28 |
SpaceAroundPointerQualifiers: Default |
| 29 |
|
| 30 |
# Space after control-flow keywords (if, for, while, switch); not after function calls |
| 31 |
SpaceBeforeParens: ControlStatements |
| 32 |
SpacesInParentheses: false |
| 33 |
SpaceAfterCStyleCast: false |
| 34 |
|
| 35 |
# When arguments wrap, indent by ContinuationIndentWidth rather than aligning to paren |
| 36 |
AlignAfterOpenBracket: AlwaysBreak |
| 37 |
ContinuationIndentWidth: 4 |
| 38 |
|
| 39 |
# Allow short function bodies on the same line as the opening brace |
| 40 |
AllowShortFunctionsOnASingleLine: All |
| 41 |
AllowShortIfStatementsOnASingleLine: AllIfsAndElse |
| 42 |
AllowShortLoopsOnASingleLine: true |
| 43 |
AllowShortBlocksOnASingleLine: Always |
| 44 |
AllowShortCaseLabelsOnASingleLine: true |
| 45 |
|
| 46 |
# Do not sort or regroup includes — they are in intentional project order |
| 47 |
SortIncludes: Never |
| 48 |
IncludeBlocks: Preserve |
| 49 |
|
| 50 |
# Align line continuation char as far left as possible |
| 51 |
AlignEscapedNewlines: Left |
| 52 |
|
| 53 |
# Empty lines |
| 54 |
MaxEmptyLinesToKeep: 2 |
| 55 |
KeepEmptyLinesAtTheStartOfBlocks: false |
| 56 |
|
| 57 |
# Dont reformat go:build directives |
| 58 |
CommentPragmas: '^go:build' |