blob: cff6340323b7ffa0300f5b2eae01e58c01e9a401 [file] [log] [blame]
HÃ¥kon Alsetha88dc362018-10-04 14:21:59 +02001# 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:]]*for_each[^[:space:]]*(' include/ \
69# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
70# | sort | uniq
71ForEachMacros:
72 - 'FOR_EACH'
73 - 'for_each_linux_bus'
74 - 'for_each_linux_driver'
75 - 'metal_bitmap_for_each_clear_bit'
76 - 'metal_bitmap_for_each_set_bit'
77 - 'metal_for_each_page_size_down'
78 - 'metal_for_each_page_size_up'
79 - 'metal_list_for_each'
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_SFLIST_FOR_EACH_CONTAINER'
87 - 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE'
88 - 'SYS_SFLIST_FOR_EACH_NODE'
89 - 'SYS_SFLIST_FOR_EACH_NODE_SAFE'
90 - 'SYS_SLIST_FOR_EACH_CONTAINER'
91 - 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE'
92 - 'SYS_SLIST_FOR_EACH_NODE'
93 - 'SYS_SLIST_FOR_EACH_NODE_SAFE'
94 - '_WAIT_Q_FOR_EACH'
95 - 'Z_GENLIST_FOR_EACH_CONTAINER'
96 - 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE'
97 - 'Z_GENLIST_FOR_EACH_NODE'
98 - 'Z_GENLIST_FOR_EACH_NODE_SAFE'
99
100#IncludeBlocks: Preserve # Unknown to clang-format-5.0
101IncludeCategories:
102 - Regex: '.*'
103 Priority: 1
104IncludeIsMainRegex: '(Test)?$'
105IndentCaseLabels: false
106#IndentPPDirectives: None # Unknown to clang-format-5.0
107IndentWidth: 8
108IndentWrappedFunctionNames: false
109JavaScriptQuotes: Leave
110JavaScriptWrapImports: true
111KeepEmptyLinesAtTheStartOfBlocks: false
112MacroBlockBegin: ''
113MacroBlockEnd: ''
114MaxEmptyLinesToKeep: 1
115NamespaceIndentation: Inner
116#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
117ObjCBlockIndentWidth: 8
118ObjCSpaceAfterProperty: true
119ObjCSpaceBeforeProtocolList: true
120
121# Taken from git's rules
122#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
123PenaltyBreakBeforeFirstCallParameter: 30
124PenaltyBreakComment: 10
125PenaltyBreakFirstLessLess: 0
126PenaltyBreakString: 10
127PenaltyExcessCharacter: 100
128PenaltyReturnTypeOnItsOwnLine: 60
129
130PointerAlignment: Right
131ReflowComments: false
132SortIncludes: false
133#SortUsingDeclarations: false # Unknown to clang-format-4.0
134SpaceAfterCStyleCast: false
135SpaceAfterTemplateKeyword: true
136SpaceBeforeAssignmentOperators: true
137#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
138#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
139SpaceBeforeParens: ControlStatements
140#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
141SpaceInEmptyParentheses: false
142SpacesBeforeTrailingComments: 1
143SpacesInAngles: false
144SpacesInContainerLiterals: false
145SpacesInCStyleCastParentheses: false
146SpacesInParentheses: false
147SpacesInSquareBrackets: false
148Standard: Cpp03
149TabWidth: 8
150UseTab: Always
151...