• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0
2#
3# clang-format configuration file. Intended for clang-format >= 4.
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
16#AlignEscapedNewlines: Left # Unknown to clang-format-4.0
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 # Unknown to clang-format-5.0
41  BeforeCatch: false
42  BeforeElse: false
43  IndentBraces: false
44  #SplitEmptyFunction: true # Unknown to clang-format-4.0
45  #SplitEmptyRecord: true # Unknown to clang-format-4.0
46  #SplitEmptyNamespace: true # Unknown to clang-format-4.0
47BreakBeforeBinaryOperators: None
48BreakBeforeBraces: Custom
49#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
50BreakBeforeTernaryOperators: false
51BreakConstructorInitializersBeforeComma: false
52#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
53BreakAfterJavaFieldAnnotations: false
54BreakStringLiterals: false
55ColumnLimit: 80
56CommentPragmas: '^ IWYU pragma:'
57#CompactNamespaces: false # Unknown to clang-format-4.0
58ConstructorInitializerAllOnOneLineOrOnePerLine: false
59ConstructorInitializerIndentWidth: 8
60ContinuationIndentWidth: 8
61Cpp11BracedListStyle: false
62DerivePointerAlignment: false
63DisableFormat: false
64ExperimentalAutoDetectBinPacking: false
65#FixNamespaceComments: false # Unknown to clang-format-4.0
66
67# Taken from:
68#   git grep -h '^#define [^[:space:]]*FOREACH[^[:space:]]*(' cras/ \
69#   | sed "s,^#define \([^[:space:]]*FOREACH[^[:space:]]*\)(.*$,  - '\1'," \
70#   | sort | uniq
71ForEachMacros:
72  - 'ARRAY_ELEMENT_FOREACH'
73  - 'DL_FOREACH'
74  - 'DL_FOREACH_INTERNAL'
75  - 'LL_FOREACH'
76  - 'LL_FOREACH_SAFE'
77
78#IncludeBlocks: Preserve # Unknown to clang-format-5.0
79IncludeCategories:
80  - Regex: '.*'
81    Priority: 1
82IncludeIsMainRegex: '(Test)?$'
83IndentCaseLabels: false
84#IndentPPDirectives: None # Unknown to clang-format-5.0
85IndentWidth: 8
86IndentWrappedFunctionNames: false
87JavaScriptQuotes: Leave
88JavaScriptWrapImports: true
89KeepEmptyLinesAtTheStartOfBlocks: false
90MacroBlockBegin: ''
91MacroBlockEnd: ''
92MaxEmptyLinesToKeep: 1
93NamespaceIndentation: Inner
94#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
95ObjCBlockIndentWidth: 8
96ObjCSpaceAfterProperty: true
97ObjCSpaceBeforeProtocolList: true
98
99# Taken from git's rules
100#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
101PenaltyBreakBeforeFirstCallParameter: 30
102PenaltyBreakComment: 10
103PenaltyBreakFirstLessLess: 0
104PenaltyBreakString: 10
105PenaltyExcessCharacter: 100
106PenaltyReturnTypeOnItsOwnLine: 60
107
108PointerAlignment: Right
109ReflowComments: false
110SortIncludes: false
111#SortUsingDeclarations: false # Unknown to clang-format-4.0
112SpaceAfterCStyleCast: false
113SpaceAfterTemplateKeyword: true
114SpaceBeforeAssignmentOperators: true
115#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
116#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
117SpaceBeforeParens: ControlStatements
118#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
119SpaceInEmptyParentheses: false
120SpacesBeforeTrailingComments: 1
121SpacesInAngles: false
122SpacesInContainerLiterals: false
123SpacesInCStyleCastParentheses: false
124SpacesInParentheses: false
125SpacesInSquareBrackets: false
126Standard: Cpp03
127TabWidth: 8
128UseTab: Always
129...
130