diff options
Diffstat (limited to '.clang-format')
| -rw-r--r-- | .clang-format | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..0929f7f --- /dev/null +++ b/.clang-format | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | BasedOnStyle: LLVM | ||
| 2 | Language: Cpp | ||
| 3 | |||
| 4 | # ------------------------------------------------------------------- | ||
| 5 | # Indentation & layout | ||
| 6 | # ------------------------------------------------------------------- | ||
| 7 | IndentWidth: 2 | ||
| 8 | TabWidth: 2 | ||
| 9 | UseTab: Never | ||
| 10 | ContinuationIndentWidth: 2 | ||
| 11 | |||
| 12 | IndentCaseLabels: true | ||
| 13 | IndentGotoLabels: true | ||
| 14 | IndentPPDirectives: None | ||
| 15 | IndentExternBlock: NoIndent | ||
| 16 | |||
| 17 | # ------------------------------------------------------------------- | ||
| 18 | # Line breaking | ||
| 19 | # ------------------------------------------------------------------- | ||
| 20 | ColumnLimit: 0 | ||
| 21 | |||
| 22 | AllowAllParametersOfDeclarationOnNextLine: false | ||
| 23 | AllowAllArgumentsOnNextLine: false | ||
| 24 | |||
| 25 | AllowShortFunctionsOnASingleLine: None | ||
| 26 | AllowShortIfStatementsOnASingleLine: Never | ||
| 27 | AllowShortLoopsOnASingleLine: false | ||
| 28 | AllowShortBlocksOnASingleLine: Never | ||
| 29 | AllowShortCaseLabelsOnASingleLine: false | ||
| 30 | |||
| 31 | AlwaysBreakAfterReturnType: All | ||
| 32 | AlwaysBreakTemplateDeclarations: No # harmless for C | ||
| 33 | |||
| 34 | BreakBeforeBinaryOperators: None | ||
| 35 | |||
| 36 | # ------------------------------------------------------------------- | ||
| 37 | # Braces (Allman style) | ||
| 38 | # ------------------------------------------------------------------- | ||
| 39 | BreakBeforeBraces: Allman | ||
| 40 | |||
| 41 | BraceWrapping: | ||
| 42 | AfterCaseLabel: true | ||
| 43 | BeforeElse: true | ||
| 44 | BeforeCatch: true | ||
| 45 | SplitEmptyFunction: true | ||
| 46 | SplitEmptyRecord: true | ||
| 47 | SplitEmptyNamespace: true | ||
| 48 | |||
| 49 | # NOTE: | ||
| 50 | # AfterControlStatement / AfterFunction / AfterStruct / AfterEnum / AfterUnion | ||
| 51 | # are IMPLIED by Allman and must NOT be redundantly specified. | ||
| 52 | |||
| 53 | # ------------------------------------------------------------------- | ||
| 54 | # Spacing | ||
| 55 | # ------------------------------------------------------------------- | ||
| 56 | SpaceBeforeParens: ControlStatements | ||
| 57 | SpaceBeforeAssignmentOperators: true | ||
| 58 | SpaceBeforeRangeBasedForLoopColon: true # ignored in C, harmless | ||
| 59 | |||
| 60 | SpacesInParentheses: false | ||
| 61 | SpacesInSquareBrackets: false | ||
| 62 | SpacesInAngles: false | ||
| 63 | SpaceInEmptyParentheses: false | ||
| 64 | SpacesBeforeTrailingComments: 1 | ||
| 65 | |||
| 66 | PointerAlignment: Right | ||
| 67 | DerivePointerAlignment: false | ||
| 68 | |||
| 69 | # ------------------------------------------------------------------- | ||
| 70 | # Alignment (explicitly disabled) | ||
| 71 | # ------------------------------------------------------------------- | ||
| 72 | AlignAfterOpenBracket: DontAlign | ||
| 73 | AlignOperands: false | ||
| 74 | AlignTrailingComments: false | ||
| 75 | AlignConsecutiveAssignments: false | ||
| 76 | AlignConsecutiveDeclarations: false | ||
| 77 | AlignEscapedNewlines: DontAlign | ||
| 78 | |||
| 79 | # ------------------------------------------------------------------- | ||
| 80 | # Comments | ||
| 81 | # ------------------------------------------------------------------- | ||
| 82 | ReflowComments: Never | ||
| 83 | CommentPragmas: '^ dont touch:' | ||
| 84 | KeepEmptyLinesAtTheStartOfBlocks: false | ||
| 85 | MaxEmptyLinesToKeep: 1 | ||
| 86 | |||
| 87 | # ------------------------------------------------------------------- | ||
| 88 | # Includes | ||
| 89 | # ------------------------------------------------------------------- | ||
| 90 | SortIncludes: Never | ||
| 91 | IncludeBlocks: Preserve | ||
| 92 | |||
| 93 | # ------------------------------------------------------------------- | ||
| 94 | # Macros & preprocessor | ||
| 95 | # ------------------------------------------------------------------- | ||
| 96 | MacroBlockBegin: '' | ||
| 97 | MacroBlockEnd: '' | ||
| 98 | SpaceAfterCStyleCast: false | ||
| 99 | |||
| 100 | # ------------------------------------------------------------------- | ||
| 101 | # C-specific | ||
| 102 | # ------------------------------------------------------------------- | ||
| 103 | Cpp11BracedListStyle: false | ||
| 104 | DisableFormat: false | ||
