• 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:]]*for_each[^[:space:]]*(' include/ \
69#   | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$,  - '\1'," \
70#   | sort | uniq
71ForEachMacros:
72  - 'list_for_each_safe'
73  - 'nl_list_for_each_entry'
74  - 'nla_for_each_attr'
75  - 'nla_for_each_nested'
76  - 'nlmsg_for_each'
77  - 'nlmsg_for_each_attr'
78  - 'nlmsg_for_each_msg'
79
80#IncludeBlocks: Preserve # Unknown to clang-format-5.0
81IncludeCategories:
82  - Regex: '.*'
83    Priority: 1
84IncludeIsMainRegex: '(Test)?$'
85IndentCaseLabels: false
86#IndentPPDirectives: None # Unknown to clang-format-5.0
87IndentWidth: 8
88IndentWrappedFunctionNames: false
89JavaScriptQuotes: Leave
90JavaScriptWrapImports: true
91KeepEmptyLinesAtTheStartOfBlocks: false
92MacroBlockBegin: ''
93MacroBlockEnd: ''
94MaxEmptyLinesToKeep: 1
95NamespaceIndentation: None
96#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
97ObjCBlockIndentWidth: 8
98ObjCSpaceAfterProperty: true
99ObjCSpaceBeforeProtocolList: true
100
101# Taken from git's rules
102#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
103PenaltyBreakBeforeFirstCallParameter: 30
104PenaltyBreakComment: 10
105PenaltyBreakFirstLessLess: 0
106PenaltyBreakString: 10
107PenaltyExcessCharacter: 100
108PenaltyReturnTypeOnItsOwnLine: 60
109
110PointerAlignment: Right
111ReflowComments: false
112SortIncludes: false
113#SortUsingDeclarations: false # Unknown to clang-format-4.0
114SpaceAfterCStyleCast: false
115SpaceAfterTemplateKeyword: true
116SpaceBeforeAssignmentOperators: true
117#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
118#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
119SpaceBeforeParens: ControlStatements
120#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
121SpaceInEmptyParentheses: false
122SpacesBeforeTrailingComments: 1
123SpacesInAngles: false
124SpacesInContainerLiterals: false
125SpacesInCStyleCastParentheses: false
126SpacesInParentheses: false
127SpacesInSquareBrackets: false
128Standard: Cpp03
129TabWidth: 8
130UseTab: Always
131...
132