1 # SPDX-License-Identifier: GPL-2.0
3 # clang-format configuration file. Intended for clang-format >= 4.
5 # For more information, see:
7 # Documentation/process/clang-format.rst
8 # https://clang.llvm.org/docs/ClangFormat.html
9 # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
12 AccessModifierOffset: -4
13 AlignAfterOpenBracket: Align
14 AlignConsecutiveAssignments: false
15 AlignConsecutiveDeclarations: false
16 #AlignEscapedNewlines: Left # Unknown to clang-format-4.0
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
33 AfterControlStatement: false
37 AfterObjCDeclaration: false
40 #AfterExternBlock: false # Unknown to clang-format-5.0
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
47 BreakBeforeBinaryOperators: None
48 BreakBeforeBraces: Custom
49 #BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
50 BreakBeforeTernaryOperators: false
51 BreakConstructorInitializersBeforeComma: false
52 #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
53 BreakAfterJavaFieldAnnotations: false
54 BreakStringLiterals: false
56 CommentPragmas: '^ IWYU pragma:'
57 #CompactNamespaces: false # Unknown to clang-format-4.0
58 ConstructorInitializerAllOnOneLineOrOnePerLine: false
59 ConstructorInitializerIndentWidth: 8
60 ContinuationIndentWidth: 8
61 Cpp11BracedListStyle: false
62 DerivePointerAlignment: false
64 ExperimentalAutoDetectBinPacking: false
65 #FixNamespaceComments: false # Unknown to clang-format-4.0
68 # git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ \
69 # | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
72 - 'list_for_each_entry'
73 - 'list_for_each_entry_safe'
74 - 'mnl_attr_for_each_nested'
76 - 'hlist_for_each_safe'
77 - 'hlist_for_each_entry'
79 #IncludeBlocks: Preserve # Unknown to clang-format-5.0
83 IncludeIsMainRegex: '(Test)?$'
84 IndentCaseLabels: false
85 #IndentPPDirectives: None # Unknown to clang-format-5.0
87 IndentWrappedFunctionNames: false
88 JavaScriptQuotes: Leave
89 JavaScriptWrapImports: true
90 KeepEmptyLinesAtTheStartOfBlocks: false
93 MaxEmptyLinesToKeep: 1
94 NamespaceIndentation: Inner
95 #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
96 ObjCBlockIndentWidth: 8
97 ObjCSpaceAfterProperty: true
98 ObjCSpaceBeforeProtocolList: true
100 # Taken from git's rules
101 #PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
102 PenaltyBreakBeforeFirstCallParameter: 30
103 PenaltyBreakComment: 10
104 PenaltyBreakFirstLessLess: 0
105 PenaltyBreakString: 10
106 PenaltyExcessCharacter: 100
107 PenaltyReturnTypeOnItsOwnLine: 60
109 PointerAlignment: Right
110 ReflowComments: false
112 #SortUsingDeclarations: false # Unknown to clang-format-4.0
113 SpaceAfterCStyleCast: false
114 SpaceAfterTemplateKeyword: true
115 SpaceBeforeAssignmentOperators: true
116 #SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
117 #SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
118 SpaceBeforeParens: ControlStatements
119 #SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
120 SpaceInEmptyParentheses: false
121 SpacesBeforeTrailingComments: 1
122 SpacesInAngles: false
123 SpacesInContainerLiterals: false
124 SpacesInCStyleCastParentheses: false
125 SpacesInParentheses: false
126 SpacesInSquareBrackets: false