Debian Codegraph @

.clang-format

raw
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 ---
12 AccessModifierOffset: -4
13 AlignAfterOpenBracket: Align
14 AlignConsecutiveAssignments: false
15 AlignConsecutiveDeclarations: false
16 #AlignEscapedNewlines: Left # Unknown to clang-format-4.0
17 AlignOperands: true
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
31 BraceWrapping:
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
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
55 ColumnLimit: 80
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
63 DisableFormat: false
64 ExperimentalAutoDetectBinPacking: false
65 #FixNamespaceComments: false # Unknown to clang-format-4.0
66
67 # Taken from:
68 # grep -Rh '^#define [^[:space:]]*for_each[^[:space:]]*(' build/include/ \
69 # | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
70 # | sort | uniq
71 ForEachMacros:
72 - 'list_for_each'
73 - 'list_for_each_off'
74 - 'list_for_each_off_dir_'
75 - 'list_for_each_rev'
76 - 'list_for_each_rev_off'
77 - 'list_for_each_rev_safe'
78 - 'list_for_each_rev_safe_off'
79 - 'list_for_each_safe'
80 - 'list_for_each_safe_off'
81 - 'list_for_each_safe_off_dir_'
82
83 #IncludeBlocks: Preserve # Unknown to clang-format-5.0
84 IncludeCategories:
85 - Regex: '.*'
86 Priority: 1
87 IncludeIsMainRegex: '(Test)?$'
88 IndentCaseLabels: false
89 #IndentPPDirectives: None # Unknown to clang-format-5.0
90 IndentWidth: 8
91 IndentWrappedFunctionNames: false
92 JavaScriptQuotes: Leave
93 JavaScriptWrapImports: true
94 KeepEmptyLinesAtTheStartOfBlocks: false
95 MacroBlockBegin: ''
96 MacroBlockEnd: ''
97 MaxEmptyLinesToKeep: 1
98 NamespaceIndentation: Inner
99 #ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0
100 ObjCBlockIndentWidth: 8
101 ObjCSpaceAfterProperty: true
102 ObjCSpaceBeforeProtocolList: true
103
104 # Taken from git's rules
105 #PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0
106 PenaltyBreakBeforeFirstCallParameter: 30
107 PenaltyBreakComment: 10
108 PenaltyBreakFirstLessLess: 0
109 PenaltyBreakString: 10
110 PenaltyExcessCharacter: 100
111 PenaltyReturnTypeOnItsOwnLine: 60
112
113 PointerAlignment: Right
114 ReflowComments: false
115 SortIncludes: false
116 #SortUsingDeclarations: false # Unknown to clang-format-4.0
117 SpaceAfterCStyleCast: false
118 SpaceAfterTemplateKeyword: true
119 SpaceBeforeAssignmentOperators: true
120 #SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0
121 #SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0
122 SpaceBeforeParens: ControlStatements
123 #SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0
124 SpaceInEmptyParentheses: false
125 SpacesBeforeTrailingComments: 1
126 SpacesInAngles: false
127 SpacesInContainerLiterals: false
128 SpacesInCStyleCastParentheses: false
129 SpacesInParentheses: false
130 SpacesInSquareBrackets: false
131 Standard: Cpp03
132 TabWidth: 8
133 UseTab: Always
134 ...