| 1 | #
|
|---|
| 2 | # SPDX-FileCopyrightText: 2022 HelenOS Project
|
|---|
| 3 | # SPDX-License-Identifier: CC0-1.0
|
|---|
| 4 | #
|
|---|
| 5 | #
|
|---|
| 6 | # This format definition attempts to be as close to the style of existing
|
|---|
| 7 | # HelenOS code as possible. However, there are several significant issues:
|
|---|
| 8 | #
|
|---|
| 9 | # "AlignEscapedNewlines: DontAlign" currently hangs
|
|---|
| 10 | # the formatter on some files.
|
|---|
| 11 | #
|
|---|
| 12 | # The formatter currently isn't able to align macro definitions,
|
|---|
| 13 | # and removes existing alignment in files.
|
|---|
| 14 | # (There is a patch for this, but it hasn't been integrated yet.)
|
|---|
| 15 | #
|
|---|
| 16 | # SpacesBeforeTrailingComments don't apply to C-style comments.
|
|---|
| 17 | #
|
|---|
| 18 | # enum definition is always crammed into a single line if it fits,
|
|---|
| 19 | # and there is no option to put members on separate lines.
|
|---|
| 20 | #
|
|---|
| 21 | # Possibly others.
|
|---|
| 22 | #
|
|---|
| 23 | #
|
|---|
| 24 | # Provisions are made to reformat the entire source tree via 'make format',
|
|---|
| 25 | # but due to the above, this shouldn't be done except to evaluate the
|
|---|
| 26 | # impact. Reformatting a single source file can be done using
|
|---|
| 27 | #
|
|---|
| 28 | # clang-format -i source/file.c
|
|---|
| 29 | #
|
|---|
| 30 | ---
|
|---|
| 31 | Language: Cpp
|
|---|
| 32 | BasedOnStyle: LLVM
|
|---|
| 33 | AccessModifierOffset: 0
|
|---|
| 34 | AlignAfterOpenBracket: DontAlign
|
|---|
| 35 | AlignConsecutiveAssignments: false
|
|---|
| 36 | AlignConsecutiveDeclarations: false
|
|---|
| 37 | AlignEscapedNewlines: Left
|
|---|
| 38 | AlignOperands: false
|
|---|
| 39 | AlignTrailingComments: true
|
|---|
| 40 | AllowAllParametersOfDeclarationOnNextLine: true
|
|---|
| 41 | AllowShortBlocksOnASingleLine: false
|
|---|
| 42 | AllowShortCaseLabelsOnASingleLine: false
|
|---|
| 43 | AllowShortFunctionsOnASingleLine: None
|
|---|
| 44 | AllowShortIfStatementsOnASingleLine: false
|
|---|
| 45 | AllowShortLoopsOnASingleLine: false
|
|---|
| 46 | AlwaysBreakAfterDefinitionReturnType: None
|
|---|
| 47 | AlwaysBreakAfterReturnType: None
|
|---|
| 48 | AlwaysBreakBeforeMultilineStrings: false
|
|---|
| 49 | AlwaysBreakTemplateDeclarations: true
|
|---|
| 50 | BinPackArguments: true
|
|---|
| 51 | BinPackParameters: true
|
|---|
| 52 | BraceWrapping:
|
|---|
| 53 | AfterClass: false
|
|---|
| 54 | AfterControlStatement: false
|
|---|
| 55 | AfterEnum: false
|
|---|
| 56 | AfterFunction: true
|
|---|
| 57 | AfterNamespace: false
|
|---|
| 58 | AfterObjCDeclaration: false
|
|---|
| 59 | AfterStruct: false
|
|---|
| 60 | AfterUnion: false
|
|---|
| 61 | BeforeCatch: false
|
|---|
| 62 | BeforeElse: false
|
|---|
| 63 | IndentBraces: false
|
|---|
| 64 | SplitEmptyFunction: true
|
|---|
| 65 | SplitEmptyRecord: true
|
|---|
| 66 | SplitEmptyNamespace: true
|
|---|
| 67 | BreakBeforeBinaryOperators: NonAssignment
|
|---|
| 68 | BreakBeforeBraces: Custom
|
|---|
| 69 | BreakBeforeInheritanceComma: true
|
|---|
| 70 | BreakBeforeTernaryOperators: true
|
|---|
| 71 | BreakConstructorInitializers: BeforeColon
|
|---|
| 72 | BreakStringLiterals: true
|
|---|
| 73 | ColumnLimit: 80
|
|---|
| 74 | CompactNamespaces: false
|
|---|
| 75 | ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
|---|
| 76 | ConstructorInitializerIndentWidth: 4
|
|---|
| 77 | ContinuationIndentWidth: 4
|
|---|
| 78 | Cpp11BracedListStyle: true
|
|---|
| 79 | DerivePointerAlignment: false
|
|---|
| 80 | FixNamespaceComments: true
|
|---|
| 81 | ForEachMacros:
|
|---|
| 82 | - foreach
|
|---|
| 83 | - Q_FOREACH
|
|---|
| 84 | - BOOST_FOREACH
|
|---|
| 85 | IncludeCategories:
|
|---|
| 86 | - Regex: '^"'
|
|---|
| 87 | Priority: 3
|
|---|
| 88 | - Regex: '^<'
|
|---|
| 89 | Priority: 2
|
|---|
| 90 | - Regex: '.*'
|
|---|
| 91 | Priority: 1
|
|---|
| 92 | IncludeIsMainRegex: '(-test)?$'
|
|---|
| 93 | IndentCaseLabels: false
|
|---|
| 94 | IndentWidth: 8
|
|---|
| 95 | IndentWrappedFunctionNames: false
|
|---|
| 96 | KeepEmptyLinesAtTheStartOfBlocks: true
|
|---|
| 97 | MacroBlockBegin: ''
|
|---|
| 98 | MacroBlockEnd: ''
|
|---|
| 99 | MaxEmptyLinesToKeep: 1
|
|---|
| 100 | NamespaceIndentation: None
|
|---|
| 101 | PenaltyBreakAssignment: 2
|
|---|
| 102 | PenaltyBreakBeforeFirstCallParameter: 19
|
|---|
| 103 | PenaltyBreakComment: 300
|
|---|
| 104 | PenaltyBreakFirstLessLess: 120
|
|---|
| 105 | PenaltyBreakString: 1000
|
|---|
| 106 | PenaltyExcessCharacter: 1000000
|
|---|
| 107 | PenaltyReturnTypeOnItsOwnLine: 60
|
|---|
| 108 | PointerAlignment: Right
|
|---|
| 109 | ReflowComments: true
|
|---|
| 110 | SortIncludes: true
|
|---|
| 111 | SortUsingDeclarations: true
|
|---|
| 112 | SpaceAfterCStyleCast: true
|
|---|
| 113 | SpaceAfterTemplateKeyword: false
|
|---|
| 114 | SpaceBeforeAssignmentOperators: true
|
|---|
| 115 | SpaceBeforeParens: ControlStatements
|
|---|
| 116 | SpaceInEmptyParentheses: false
|
|---|
| 117 | SpacesBeforeTrailingComments: 2
|
|---|
| 118 | SpacesInAngles: false
|
|---|
| 119 | SpacesInContainerLiterals: false
|
|---|
| 120 | SpacesInCStyleCastParentheses: false
|
|---|
| 121 | SpacesInParentheses: false
|
|---|
| 122 | SpacesInSquareBrackets: false
|
|---|
| 123 | Standard: Cpp11
|
|---|
| 124 | TabWidth: 8
|
|---|
| 125 | UseTab: ForIndentation
|
|---|
| 126 | ...
|
|---|
| 127 |
|
|---|