blob: b40571f8598c663c377737b40b4446ecb6be4977 [file] [log] [blame]
Trusted Firmware CI78243aa2023-03-09 18:46:41 +00001# 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---
12AccessModifierOffset: -4
13AlignAfterOpenBracket: Align
14AlignConsecutiveAssignments: false
15AlignConsecutiveDeclarations: false
16AlignEscapedNewlines: Left
17AlignOperands: true
18AlignTrailingComments: false
19AllowAllParametersOfDeclarationOnNextLine: false
20AllowShortBlocksOnASingleLine: false
21AllowShortCaseLabelsOnASingleLine: false
22AllowShortFunctionsOnASingleLine: None
23AllowShortIfStatementsOnASingleLine: false
24AllowShortLoopsOnASingleLine: false
25AlwaysBreakAfterDefinitionReturnType: None
26AlwaysBreakAfterReturnType: None
27AlwaysBreakBeforeMultilineStrings: false
28AlwaysBreakTemplateDeclarations: false
29BinPackArguments: true
30BinPackParameters: true
31BraceWrapping:
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
47BreakBeforeBinaryOperators: None
48BreakBeforeBraces: Custom
49BreakBeforeInheritanceComma: false
50BreakBeforeTernaryOperators: false
51BreakConstructorInitializersBeforeComma: false
52BreakConstructorInitializers: BeforeComma
53BreakAfterJavaFieldAnnotations: false
54BreakStringLiterals: false
55ColumnLimit: 80
56CommentPragmas: '^ IWYU pragma:'
57CompactNamespaces: false
58ConstructorInitializerAllOnOneLineOrOnePerLine: false
59ConstructorInitializerIndentWidth: 8
60ContinuationIndentWidth: 8
61Cpp11BracedListStyle: false
62DerivePointerAlignment: false
63DisableFormat: false
64ExperimentalAutoDetectBinPacking: false
65FixNamespaceComments: 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
71ForEachMacros:
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
78IncludeBlocks: Regroup
79IncludeCategories:
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
90IncludeIsMainRegex: '(Test)?$'
91IndentCaseLabels: false
92IndentGotoLabels: false
93IndentPPDirectives: None
94IndentWidth: 8
95IndentWrappedFunctionNames: false
96JavaScriptQuotes: Leave
97JavaScriptWrapImports: true
98KeepEmptyLinesAtTheStartOfBlocks: false
99MacroBlockBegin: ''
100MacroBlockEnd: ''
101MaxEmptyLinesToKeep: 1
102NamespaceIndentation: None
103ObjCBinPackProtocolList: Auto
104ObjCBlockIndentWidth: 8
105ObjCSpaceAfterProperty: true
106ObjCSpaceBeforeProtocolList: true
107
108# Taken from git's rules
109PenaltyBreakAssignment: 10
110PenaltyBreakBeforeFirstCallParameter: 30
111PenaltyBreakComment: 10
112PenaltyBreakFirstLessLess: 0
113PenaltyBreakString: 10
114PenaltyExcessCharacter: 100
115PenaltyReturnTypeOnItsOwnLine: 60
116
117PointerAlignment: Right
118ReflowComments: false
119SortIncludes: true
120SortUsingDeclarations: false
121SpaceAfterCStyleCast: false
122SpaceAfterTemplateKeyword: true
123SpaceBeforeAssignmentOperators: true
124SpaceBeforeCtorInitializerColon: true
125SpaceBeforeInheritanceColon: true
126SpaceBeforeParens: ControlStatementsExceptForEachMacros
127SpaceBeforeRangeBasedForLoopColon: true
128SpaceInEmptyParentheses: false
129SpacesBeforeTrailingComments: 1
130SpacesInAngles: false
131SpacesInContainerLiterals: false
132SpacesInCStyleCastParentheses: false
133SpacesInParentheses: false
134SpacesInSquareBrackets: false
135Standard: Cpp03
136TabWidth: 8
137UseTab: Always
138...