|
| 1 | +# SPDX-License-Identifier: GPL-2.0 |
| 2 | +# |
| 3 | +# clang-format configuration file. Intended for clang-format >= 11. |
| 4 | +# |
| 5 | +# For more information, see: |
| 6 | +# |
| 7 | +# Documentation/dev-tools/clang-format.rst |
| 8 | +# https://clang.llvm.org/docs/ClangFormat.html |
| 9 | +# https://clang.llvm.org/docs/ClangFormatStyleOptions.html |
| 10 | +# |
| 11 | +--- |
| 12 | +AccessModifierOffset: -4 |
| 13 | +AlignAfterOpenBracket: Align |
| 14 | +AlignConsecutiveAssignments: false |
| 15 | +AlignConsecutiveDeclarations: false |
| 16 | +AlignEscapedNewlines: Left |
| 17 | +AlignOperands: true |
| 18 | +AlignTrailingComments: false |
| 19 | +AllowAllParametersOfDeclarationOnNextLine: false |
| 20 | +AllowShortBlocksOnASingleLine: false |
| 21 | +AllowShortCaseLabelsOnASingleLine: false |
| 22 | +AllowShortFunctionsOnASingleLine: None |
| 23 | +AllowShortIfStatementsOnASingleLine: false |
| 24 | +AllowShortLoopsOnASingleLine: false |
| 25 | +AlwaysBreakAfterDefinitionReturnType: None |
| 26 | +AlwaysBreakAfterReturnType: None |
| 27 | +AlwaysBreakBeforeMultilineStrings: false |
| 28 | +AlwaysBreakTemplateDeclarations: false |
| 29 | +BinPackArguments: true |
| 30 | +BinPackParameters: true |
| 31 | +BraceWrapping: |
| 32 | + AfterClass: false |
| 33 | + AfterControlStatement: false |
| 34 | + AfterEnum: false |
| 35 | + AfterFunction: true |
| 36 | + AfterNamespace: true |
| 37 | + AfterObjCDeclaration: false |
| 38 | + AfterStruct: false |
| 39 | + AfterUnion: false |
| 40 | + AfterExternBlock: false |
| 41 | + BeforeCatch: false |
| 42 | + BeforeElse: false |
| 43 | + IndentBraces: false |
| 44 | + SplitEmptyFunction: true |
| 45 | + SplitEmptyRecord: true |
| 46 | + SplitEmptyNamespace: true |
| 47 | +BreakBeforeBinaryOperators: None |
| 48 | +BreakBeforeBraces: Custom |
| 49 | +BreakBeforeInheritanceComma: false |
| 50 | +BreakBeforeTernaryOperators: false |
| 51 | +BreakConstructorInitializersBeforeComma: false |
| 52 | +BreakConstructorInitializers: BeforeComma |
| 53 | +BreakAfterJavaFieldAnnotations: false |
| 54 | +BreakStringLiterals: false |
| 55 | +ColumnLimit: 120 |
| 56 | +CommentPragmas: '^ IWYU pragma:' |
| 57 | +CompactNamespaces: false |
| 58 | +ConstructorInitializerAllOnOneLineOrOnePerLine: false |
| 59 | +ConstructorInitializerIndentWidth: 8 |
| 60 | +ContinuationIndentWidth: 8 |
| 61 | +Cpp11BracedListStyle: false |
| 62 | +DerivePointerAlignment: false |
| 63 | +DisableFormat: false |
| 64 | +ExperimentalAutoDetectBinPacking: false |
| 65 | +FixNamespaceComments: false |
| 66 | + |
| 67 | +# Taken from: |
| 68 | +# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ tools/ \ |
| 69 | +# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \ |
| 70 | +# | LC_ALL=C sort -u |
| 71 | +ForEachMacros: |
| 72 | + - 'ARRAY_FOR_EACH' |
| 73 | + - 'ARRAY_FOR_EACH_PTR' |
| 74 | + - 'FOR_EACH' |
| 75 | + - 'FOR_EACH_FIXED_ARG' |
| 76 | + - 'FOR_EACH_IDX' |
| 77 | + - 'FOR_EACH_IDX_FIXED_ARG' |
| 78 | + - 'FOR_EACH_NONEMPTY_TERM' |
| 79 | + - 'FOR_EACH_FIXED_ARG_NONEMPTY_TERM' |
| 80 | + - 'RB_FOR_EACH' |
| 81 | + - 'RB_FOR_EACH_CONTAINER' |
| 82 | + - 'SYS_DLIST_FOR_EACH_CONTAINER' |
| 83 | + - 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE' |
| 84 | + - 'SYS_DLIST_FOR_EACH_NODE' |
| 85 | + - 'SYS_DLIST_FOR_EACH_NODE_SAFE' |
| 86 | + - 'SYS_SEM_LOCK' |
| 87 | + - 'SYS_SFLIST_FOR_EACH_CONTAINER' |
| 88 | + - 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE' |
| 89 | + - 'SYS_SFLIST_FOR_EACH_NODE' |
| 90 | + - 'SYS_SFLIST_FOR_EACH_NODE_SAFE' |
| 91 | + - 'SYS_SLIST_FOR_EACH_CONTAINER' |
| 92 | + - 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE' |
| 93 | + - 'SYS_SLIST_FOR_EACH_NODE' |
| 94 | + - 'SYS_SLIST_FOR_EACH_NODE_SAFE' |
| 95 | + - '_WAIT_Q_FOR_EACH' |
| 96 | + - '_WAIT_Q_FOR_EACH_SAFE' |
| 97 | + - 'Z_FOR_EACH' |
| 98 | + - 'Z_FOR_EACH_ENGINE' |
| 99 | + - 'Z_FOR_EACH_EXEC' |
| 100 | + - 'Z_FOR_EACH_FIXED_ARG' |
| 101 | + - 'Z_FOR_EACH_FIXED_ARG_EXEC' |
| 102 | + - 'Z_FOR_EACH_IDX' |
| 103 | + - 'Z_FOR_EACH_IDX_EXEC' |
| 104 | + - 'Z_FOR_EACH_IDX_FIXED_ARG' |
| 105 | + - 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC' |
| 106 | + - 'Z_GENLIST_FOR_EACH_CONTAINER' |
| 107 | + - 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE' |
| 108 | + - 'Z_GENLIST_FOR_EACH_NODE' |
| 109 | + - 'Z_GENLIST_FOR_EACH_NODE_SAFE' |
| 110 | + - 'STRUCT_SECTION_FOREACH' |
| 111 | + - 'STRUCT_SECTION_FOREACH_ALTERNATE' |
| 112 | + - 'TYPE_SECTION_FOREACH' |
| 113 | + - 'K_SPINLOCK' |
| 114 | + - 'COAP_RESOURCE_FOREACH' |
| 115 | + - 'COAP_SERVICE_FOREACH' |
| 116 | + - 'COAP_SERVICE_FOREACH_RESOURCE' |
| 117 | + - 'HTTP_RESOURCE_FOREACH' |
| 118 | + - 'HTTP_SERVER_CONTENT_TYPE_FOREACH' |
| 119 | + - 'HTTP_SERVICE_FOREACH' |
| 120 | + - 'HTTP_SERVICE_FOREACH_RESOURCE' |
| 121 | + - 'I3C_BUS_FOR_EACH_I3CDEV' |
| 122 | + - 'I3C_BUS_FOR_EACH_I2CDEV' |
| 123 | + - 'MIN_HEAP_FOREACH' |
| 124 | + - 'comp_dev_for_each_consumer' |
| 125 | + - 'comp_dev_for_each_consumer_safe' |
| 126 | + - 'comp_dev_for_each_producer' |
| 127 | + - 'comp_dev_for_each_producer_safe' |
| 128 | + |
| 129 | +IncludeBlocks: Preserve |
| 130 | +IncludeCategories: |
| 131 | + - Regex: '.*' |
| 132 | + Priority: 1 |
| 133 | +IncludeIsMainRegex: '(Test)?$' |
| 134 | +IndentCaseLabels: false |
| 135 | +IndentGotoLabels: false |
| 136 | +IndentPPDirectives: None |
| 137 | +IndentWidth: 4 |
| 138 | +IndentWrappedFunctionNames: false |
| 139 | +JavaScriptQuotes: Leave |
| 140 | +JavaScriptWrapImports: true |
| 141 | +KeepEmptyLinesAtTheStartOfBlocks: false |
| 142 | +MacroBlockBegin: '' |
| 143 | +MacroBlockEnd: '' |
| 144 | +MaxEmptyLinesToKeep: 1 |
| 145 | +NamespaceIndentation: None |
| 146 | +ObjCBinPackProtocolList: Auto |
| 147 | +ObjCBlockIndentWidth: 8 |
| 148 | +ObjCSpaceAfterProperty: true |
| 149 | +ObjCSpaceBeforeProtocolList: true |
| 150 | + |
| 151 | +# Taken from git's rules |
| 152 | +PenaltyBreakAssignment: 10 |
| 153 | +PenaltyBreakBeforeFirstCallParameter: 30 |
| 154 | +PenaltyBreakComment: 10 |
| 155 | +PenaltyBreakFirstLessLess: 0 |
| 156 | +PenaltyBreakString: 10 |
| 157 | +PenaltyExcessCharacter: 100 |
| 158 | +PenaltyReturnTypeOnItsOwnLine: 60 |
| 159 | + |
| 160 | +PointerAlignment: Right |
| 161 | +ReflowComments: false |
| 162 | +SortIncludes: false |
| 163 | +SortUsingDeclarations: false |
| 164 | +SpaceAfterCStyleCast: false |
| 165 | +SpaceAfterTemplateKeyword: true |
| 166 | +SpaceBeforeAssignmentOperators: true |
| 167 | +SpaceBeforeCtorInitializerColon: true |
| 168 | +SpaceBeforeInheritanceColon: true |
| 169 | +SpaceBeforeParens: ControlStatementsExceptForEachMacros |
| 170 | +SpaceBeforeRangeBasedForLoopColon: true |
| 171 | +SpaceInEmptyParentheses: false |
| 172 | +SpacesBeforeTrailingComments: 1 |
| 173 | +SpacesInAngles: false |
| 174 | +SpacesInContainerLiterals: false |
| 175 | +SpacesInCStyleCastParentheses: false |
| 176 | +SpacesInParentheses: false |
| 177 | +SpacesInSquareBrackets: false |
| 178 | +Standard: Cpp03 |
| 179 | +TabWidth: 4 |
| 180 | +UseTab: Never |
| 181 | +... |
0 commit comments