Debian Codegraph @

.clang-format

raw
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # clang-format configuration file. Intended for clang-format >= 11.
4 # Copied from Linux's .clang-format
5 #
6 # For more information, see:
7 #
8 # https://clang.llvm.org/docs/ClangFormat.html
9 # https://clang.llvm.org/docs/ClangFormatStyleOptions.html
10 #
11 ---
12 AccessModifierOffset: -4
13 AlignAfterOpenBracket: Align
14 AlignConsecutiveAssignments: false
15 AlignConsecutiveDeclarations: false
16 AlignEscapedNewlines: Left
17 AlignConsecutiveMacros: true
18 AlignOperands: true
19 AlignTrailingComments: false
20 AllowAllParametersOfDeclarationOnNextLine: false
21 AllowShortBlocksOnASingleLine: false
22 AllowShortCaseLabelsOnASingleLine: false
23 AllowShortFunctionsOnASingleLine: None
24 AllowShortIfStatementsOnASingleLine: false
25 AllowShortLoopsOnASingleLine: false
26 AlwaysBreakAfterDefinitionReturnType: None
27 AlwaysBreakAfterReturnType: None
28 AlwaysBreakBeforeMultilineStrings: false
29 AlwaysBreakTemplateDeclarations: false
30 BinPackArguments: true
31 BinPackParameters: true
32 BraceWrapping:
33 AfterClass: false
34 AfterControlStatement: false
35 AfterEnum: false
36 AfterFunction: true
37 AfterNamespace: true
38 AfterObjCDeclaration: false
39 AfterStruct: false
40 AfterUnion: false
41 AfterExternBlock: false
42 BeforeCatch: false
43 BeforeElse: false
44 IndentBraces: false
45 SplitEmptyFunction: true
46 SplitEmptyRecord: true
47 SplitEmptyNamespace: true
48 BreakBeforeBinaryOperators: None
49 BreakBeforeBraces: Custom
50 BreakBeforeInheritanceComma: false
51 BreakBeforeTernaryOperators: false
52 BreakConstructorInitializersBeforeComma: false
53 BreakConstructorInitializers: BeforeComma
54 BreakAfterJavaFieldAnnotations: false
55 BreakStringLiterals: false
56 ColumnLimit: 80
57 CommentPragmas: '^ IWYU pragma:'
58 CompactNamespaces: false
59 ConstructorInitializerAllOnOneLineOrOnePerLine: false
60 ConstructorInitializerIndentWidth: 8
61 ContinuationIndentWidth: 8
62 Cpp11BracedListStyle: false
63 DerivePointerAlignment: false
64 DisableFormat: false
65 ExperimentalAutoDetectBinPacking: false
66 FixNamespaceComments: false
67
68 # Taken from:
69 # while read -r sym; do
70 # printf " - '%s'\n" "$sym";
71 # done < \
72 # <(cscope -dL6 "foreach|for_each" \
73 # | awk '{ print $4 $5 }' | grep -E 'foreach|for_each' \
74 # | sed -e 's/#define//' \
75 # -e 's/*//' \
76 # -e 's/://' \
77 # -e 's/\(.*for_each.*\)(.*/\1/' \
78 # -e 's/\(.*foreach.*\)(.*/\1/' \
79 # | sort -u)
80 ForEachMacros:
81 - 'cxl_memdev_foreach'
82 - 'cxl_bus_foreach'
83 - 'cxl_port_foreach'
84 - 'cxl_decoder_foreach'
85 - 'cxl_decoder_foreach_reverse'
86 - 'cxl_target_foreach'
87 - 'cxl_dport_foreach'
88 - 'cxl_endpoint_foreach'
89 - 'cxl_port_foreach_all'
90 - 'cxl_region_foreach'
91 - 'cxl_region_foreach_safe'
92 - 'daxctl_dev_foreach'
93 - 'daxctl_mapping_foreach'
94 - 'daxctl_region_foreach'
95 - 'kmod_list_foreach'
96 - 'kmod_list_foreach_reverse'
97 - 'list_for_each'
98 - 'list_for_each_off'
99 - 'list_for_each_rev'
100 - 'list_for_each_safe'
101 - 'list_for_each_safe_off'
102 - 'ndctl_btt_foreach'
103 - 'ndctl_btt_foreach_safe'
104 - 'ndctl_bus_foreach'
105 - 'ndctl_dax_foreach'
106 - 'ndctl_dax_foreach_safe'
107 - 'ndctl_dimm_foreach'
108 - 'ndctl_dimm_foreach_in_interleave_set'
109 - 'ndctl_dimm_foreach_in_region'
110 - 'ndctl_interleave_set_foreach'
111 - 'ndctl_mapping_foreach'
112 - 'ndctl_namespace_badblock_foreach'
113 - 'ndctl_namespace_bb_foreach'
114 - 'ndctl_namespace_foreach'
115 - 'ndctl_namespace_foreach_safe'
116 - 'ndctl_pfn_foreach'
117 - 'ndctl_pfn_foreach_safe'
118 - 'ndctl_region_badblock_foreach'
119 - 'ndctl_region_foreach'
120 - 'udev_list_entry_foreach'
121
122 IncludeBlocks: Preserve
123 IncludeCategories:
124 - Regex: '.*'
125 Priority: 1
126 IncludeIsMainRegex: '(Test)?$'
127 IndentCaseLabels: false
128 IndentPPDirectives: None
129 IndentWidth: 8
130 IndentWrappedFunctionNames: false
131 JavaScriptQuotes: Leave
132 JavaScriptWrapImports: true
133 KeepEmptyLinesAtTheStartOfBlocks: false
134 MacroBlockBegin: ''
135 MacroBlockEnd: ''
136 MaxEmptyLinesToKeep: 1
137 NamespaceIndentation: None
138 ObjCBinPackProtocolList: Auto
139 ObjCBlockIndentWidth: 8
140 ObjCSpaceAfterProperty: true
141 ObjCSpaceBeforeProtocolList: true
142
143 # Taken from git's rules
144 PenaltyBreakAssignment: 10
145 PenaltyBreakBeforeFirstCallParameter: 30
146 PenaltyBreakComment: 10
147 PenaltyBreakFirstLessLess: 0
148 PenaltyBreakString: 10
149 PenaltyExcessCharacter: 100
150 PenaltyReturnTypeOnItsOwnLine: 60
151
152 PointerAlignment: Right
153 ReflowComments: false
154 SortIncludes: false
155 SortUsingDeclarations: false
156 SpaceAfterCStyleCast: false
157 SpaceAfterTemplateKeyword: true
158 SpaceBeforeAssignmentOperators: true
159 SpaceBeforeCtorInitializerColon: true
160 SpaceBeforeInheritanceColon: true
161 SpaceBeforeParens: ControlStatementsExceptForEachMacros
162 SpaceBeforeRangeBasedForLoopColon: true
163 SpaceInEmptyParentheses: false
164 SpacesBeforeTrailingComments: 1
165 SpacesInAngles: false
166 SpacesInContainerLiterals: false
167 SpacesInCStyleCastParentheses: false
168 SpacesInParentheses: false
169 SpacesInSquareBrackets: false
170 Standard: Cpp03
171 TabWidth: 8
172 UseTab: Always
173 ...