Trusted Firmware CI | 78243aa | 2023-03-09 18:46:41 +0000 | [diff] [blame] | 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/process/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: 80 |
| 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 | - 'fdt_for_each_compatible_node' |
| 73 | - 'fdt_for_each_property_offset' |
| 74 | - 'fdt_for_each_subnode' |
| 75 | - 'for_each_err_record_info' |
| 76 | - 'for_each_subscriber' |
| 77 | |
| 78 | IncludeBlocks: Regroup |
| 79 | IncludeCategories: |
| 80 | - Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbool|stdckdint|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>$' |
| 81 | Priority: 0 |
| 82 | - Regex: '^<lib/(compiler-rt|libfdt|mbedtls|zlib)/.+>$' |
| 83 | Priority: 1 |
| 84 | - Regex: '^<(platform_def\.h)|(plat/.+)>$' |
| 85 | Priority: 3 |
| 86 | - Regex: '^<.+>$' |
| 87 | Priority: 2 |
| 88 | - Regex: '^".+"$' |
| 89 | Priority: 4 |
| 90 | IncludeIsMainRegex: '(Test)?$' |
| 91 | IndentCaseLabels: false |
| 92 | IndentGotoLabels: false |
| 93 | IndentPPDirectives: None |
| 94 | IndentWidth: 8 |
| 95 | IndentWrappedFunctionNames: false |
| 96 | JavaScriptQuotes: Leave |
| 97 | JavaScriptWrapImports: true |
| 98 | KeepEmptyLinesAtTheStartOfBlocks: false |
| 99 | MacroBlockBegin: '' |
| 100 | MacroBlockEnd: '' |
| 101 | MaxEmptyLinesToKeep: 1 |
| 102 | NamespaceIndentation: None |
| 103 | ObjCBinPackProtocolList: Auto |
| 104 | ObjCBlockIndentWidth: 8 |
| 105 | ObjCSpaceAfterProperty: true |
| 106 | ObjCSpaceBeforeProtocolList: true |
| 107 | |
| 108 | # Taken from git's rules |
| 109 | PenaltyBreakAssignment: 10 |
| 110 | PenaltyBreakBeforeFirstCallParameter: 30 |
| 111 | PenaltyBreakComment: 10 |
| 112 | PenaltyBreakFirstLessLess: 0 |
| 113 | PenaltyBreakString: 10 |
| 114 | PenaltyExcessCharacter: 100 |
| 115 | PenaltyReturnTypeOnItsOwnLine: 60 |
| 116 | |
| 117 | PointerAlignment: Right |
| 118 | ReflowComments: false |
| 119 | SortIncludes: true |
| 120 | SortUsingDeclarations: false |
| 121 | SpaceAfterCStyleCast: false |
| 122 | SpaceAfterTemplateKeyword: true |
| 123 | SpaceBeforeAssignmentOperators: true |
| 124 | SpaceBeforeCtorInitializerColon: true |
| 125 | SpaceBeforeInheritanceColon: true |
| 126 | SpaceBeforeParens: ControlStatementsExceptForEachMacros |
| 127 | SpaceBeforeRangeBasedForLoopColon: true |
| 128 | SpaceInEmptyParentheses: false |
| 129 | SpacesBeforeTrailingComments: 1 |
| 130 | SpacesInAngles: false |
| 131 | SpacesInContainerLiterals: false |
| 132 | SpacesInCStyleCastParentheses: false |
| 133 | SpacesInParentheses: false |
| 134 | SpacesInSquareBrackets: false |
| 135 | Standard: Cpp03 |
| 136 | TabWidth: 8 |
| 137 | UseTab: Always |
| 138 | ... |