|
| 1 | +# .clang-format for LTFS (Linear Tape File System) |
| 2 | +# Derived from the LTFS C Language Coding Style Guide. |
| 3 | +# |
| 4 | +# NOTE: Several guide rules cannot be enforced by clang-format and must be |
| 5 | +# observed manually or via other tooling: |
| 6 | +# - Naming conventions (snake_case, capital enumerator entries, etc.) |
| 7 | +# - Positive logic naming for boolean parameters |
| 8 | +# - Doxygen comment content and placement |
| 9 | +# - sizeof(variable) preferred over sizeof(type) |
| 10 | +# - Include guard presence in headers |
| 11 | +# - File preamble / copyright block |
| 12 | +# - C++-style comments (//) restricted to logic comment-out only |
| 13 | +# - Magic editor lines (vim/emacs modelines) |
| 14 | +--- |
| 15 | +Language: C |
| 16 | +ColumnLimit: 120 |
| 17 | +IndentWidth: 2 |
| 18 | +UseTab: Always |
| 19 | +TabWidth: 2 |
| 20 | +ReflowComments: false |
| 21 | +BreakBeforeBraces: Custom |
| 22 | +BraceWrapping: |
| 23 | + AfterCaseLabel: false |
| 24 | + AfterClass: true |
| 25 | + AfterControlStatement: false |
| 26 | + AfterEnum: true |
| 27 | + AfterFunction: true |
| 28 | + AfterNamespace: true |
| 29 | + AfterStruct: true |
| 30 | + AfterUnion: true |
| 31 | + AfterExternBlock: true |
| 32 | + BeforeCatch: false |
| 33 | + BeforeElse: false |
| 34 | + BeforeLambdaBody: false |
| 35 | + BeforeWhile: false |
| 36 | + IndentBraces: false |
| 37 | + SplitEmptyFunction: false |
| 38 | + SplitEmptyRecord: false |
| 39 | + SplitEmptyNamespace: false |
| 40 | +AllowShortIfStatementsOnASingleLine: WithoutElse |
| 41 | +AllowShortLoopsOnASingleLine: false |
| 42 | +AllowShortBlocksOnASingleLine: Never |
| 43 | +AllowShortFunctionsOnASingleLine: None |
| 44 | +SpaceBeforeParens: ControlStatements |
| 45 | +SpaceInEmptyParentheses: false |
| 46 | +SpacesInParentheses: false |
| 47 | +SpacesInSquareBrackets: false |
| 48 | +SpaceAfterCStyleCast: false |
| 49 | +SpaceBeforeAssignmentOperators: true |
| 50 | +SpaceBeforeCpp11BracedList: false |
| 51 | +IndentCaseLabels: true |
| 52 | +IndentCaseBlocks: false |
| 53 | +AlwaysBreakAfterReturnType: None |
| 54 | +AlignAfterOpenBracket: Align |
| 55 | +BinPackParameters: false |
| 56 | +BinPackArguments: false |
| 57 | +PointerAlignment: Right |
| 58 | +ReferenceAlignment: Right |
| 59 | +IndentPPDirectives: AfterHash |
| 60 | +AlignConsecutiveAssignments: |
| 61 | + Enabled: false |
| 62 | +AlignConsecutiveDeclarations: |
| 63 | + Enabled: false |
| 64 | +AlignEscapedNewlines: Left |
| 65 | +AlignOperands: Align |
| 66 | +AlignTrailingComments: |
| 67 | + Kind: Always |
| 68 | + OverEmptyLines: 1 |
| 69 | +CompactNamespaces: false |
| 70 | +IncludeBlocks: Preserve |
| 71 | +SortIncludes: CaseSensitive |
| 72 | +MaxEmptyLinesToKeep: 1 |
| 73 | +KeepEmptyLinesAtTheStartOfBlocks: false |
| 74 | +SpacesBeforeTrailingComments: 2 |
| 75 | +Cpp11BracedListStyle: false |
| 76 | +InsertTrailingCommas: None |
0 commit comments