Browse code

Explicitly set clang-format version to 16

ragusaa authored on 2024/04/04 05:35:23
Showing 3 changed files
... ...
@@ -2,40 +2,65 @@
2 2
 Language:        Cpp
3 3
 AccessModifierOffset: -2
4 4
 AlignAfterOpenBracket: Align
5
-AlignConsecutiveMacros: false
6
-AlignConsecutiveAssignments: true
7
-AlignConsecutiveBitFields: false
8
-AlignConsecutiveDeclarations: false
5
+AlignArrayOfStructures: None
6
+AlignConsecutiveAssignments:
7
+  Enabled:         true
8
+  AcrossEmptyLines: false
9
+  AcrossComments:  false
10
+  AlignCompound:   false
11
+  PadOperators:    true
12
+AlignConsecutiveBitFields:
13
+  Enabled:         false
14
+  AcrossEmptyLines: false
15
+  AcrossComments:  false
16
+  AlignCompound:   false
17
+  PadOperators:    false
18
+AlignConsecutiveDeclarations:
19
+  Enabled:         false
20
+  AcrossEmptyLines: false
21
+  AcrossComments:  false
22
+  AlignCompound:   false
23
+  PadOperators:    false
24
+AlignConsecutiveMacros:
25
+  Enabled:         false
26
+  AcrossEmptyLines: false
27
+  AcrossComments:  false
28
+  AlignCompound:   false
29
+  PadOperators:    false
9 30
 AlignEscapedNewlines: Left
10 31
 AlignOperands:   Align
11
-AlignTrailingComments: true
32
+AlignTrailingComments:
33
+  Kind:            Always
34
+  OverEmptyLines:  0
12 35
 AllowAllArgumentsOnNextLine: true
13
-AllowAllConstructorInitializersOnNextLine: true
14 36
 AllowAllParametersOfDeclarationOnNextLine: true
15
-AllowShortEnumsOnASingleLine: true
16 37
 AllowShortBlocksOnASingleLine: Never
17 38
 AllowShortCaseLabelsOnASingleLine: false
39
+AllowShortEnumsOnASingleLine: true
18 40
 AllowShortFunctionsOnASingleLine: Empty
19
-AllowShortLambdasOnASingleLine: All
20 41
 AllowShortIfStatementsOnASingleLine: WithoutElse
42
+AllowShortLambdasOnASingleLine: All
21 43
 AllowShortLoopsOnASingleLine: true
22 44
 AlwaysBreakAfterDefinitionReturnType: None
23 45
 AlwaysBreakAfterReturnType: None
24 46
 AlwaysBreakBeforeMultilineStrings: false
25 47
 AlwaysBreakTemplateDeclarations: MultiLine
48
+AttributeMacros:
49
+  - __capability
26 50
 BinPackArguments: true
27 51
 BinPackParameters: true
52
+BitFieldColonSpacing: Both
28 53
 BraceWrapping:
29 54
   AfterCaseLabel:  false
30 55
   AfterClass:      true
31 56
   AfterControlStatement: Never
32 57
   AfterEnum:       false
58
+  AfterExternBlock: false
33 59
   AfterFunction:   true
34 60
   AfterNamespace:  true
35 61
   AfterObjCDeclaration: false
36 62
   AfterStruct:     false
37 63
   AfterUnion:      false
38
-  AfterExternBlock: false
39 64
   BeforeCatch:     false
40 65
   BeforeElse:      false
41 66
   BeforeLambdaBody: false
... ...
@@ -44,55 +69,75 @@ BraceWrapping:
44 44
   SplitEmptyFunction: true
45 45
   SplitEmptyRecord: true
46 46
   SplitEmptyNamespace: true
47
+BreakAfterAttributes: Never
48
+BreakAfterJavaFieldAnnotations: false
49
+BreakArrays:     true
47 50
 BreakBeforeBinaryOperators: None
51
+BreakBeforeConceptDeclarations: Always
48 52
 BreakBeforeBraces: Linux
49
-BreakBeforeInheritanceComma: false
50
-BreakInheritanceList: BeforeColon
53
+BreakBeforeInlineASMColon: OnlyMultiline
51 54
 BreakBeforeTernaryOperators: true
52
-BreakConstructorInitializersBeforeComma: false
53 55
 BreakConstructorInitializers: BeforeColon
54
-BreakAfterJavaFieldAnnotations: false
56
+BreakInheritanceList: BeforeColon
55 57
 BreakStringLiterals: true
56 58
 ColumnLimit:     0
57 59
 CommentPragmas:  '^ IWYU pragma:'
58 60
 CompactNamespaces: false
59
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
60 61
 ConstructorInitializerIndentWidth: 4
61 62
 ContinuationIndentWidth: 4
62 63
 Cpp11BracedListStyle: true
63
-DeriveLineEnding: true
64 64
 DerivePointerAlignment: true
65 65
 DisableFormat:   false
66
+EmptyLineAfterAccessModifier: Never
67
+EmptyLineBeforeAccessModifier: LogicalBlock
66 68
 ExperimentalAutoDetectBinPacking: false
67 69
 FixNamespaceComments: true
68 70
 ForEachMacros:
69 71
   - foreach
70 72
   - Q_FOREACH
71 73
   - BOOST_FOREACH
74
+IfMacros:
75
+  - KJ_IF_MAYBE
72 76
 IncludeBlocks:   Preserve
73 77
 IncludeCategories:
74 78
   - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
75 79
     Priority:        2
76 80
     SortPriority:    0
81
+    CaseSensitive:   false
77 82
   - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
78 83
     Priority:        3
79 84
     SortPriority:    0
85
+    CaseSensitive:   false
80 86
   - Regex:           '.*'
81 87
     Priority:        1
82 88
     SortPriority:    0
89
+    CaseSensitive:   false
83 90
 IncludeIsMainRegex: '(Test)?$'
84 91
 IncludeIsMainSourceRegex: ''
85
-IndentCaseLabels: true
92
+IndentAccessModifiers: false
86 93
 IndentCaseBlocks: false
94
+IndentCaseLabels: true
95
+IndentExternBlock: AfterExternBlock
87 96
 IndentGotoLabels: true
88 97
 IndentPPDirectives: None
89
-IndentExternBlock: AfterExternBlock
98
+IndentRequiresClause: true
90 99
 IndentWidth:     4
91 100
 IndentWrappedFunctionNames: false
101
+InsertBraces:    false
102
+InsertNewlineAtEOF: false
92 103
 InsertTrailingCommas: None
104
+IntegerLiteralSeparator:
105
+  Binary:          0
106
+  BinaryMinDigits: 0
107
+  Decimal:         0
108
+  DecimalMinDigits: 0
109
+  Hex:             0
110
+  HexMinDigits:    0
93 111
 JavaScriptQuotes: Leave
94 112
 JavaScriptWrapImports: true
95 113
 KeepEmptyLinesAtTheStartOfBlocks: true
114
+LambdaBodyIndentation: Signature
115
+LineEnding:      DeriveLF
96 116
 MacroBlockBegin: ''
97 117
 MacroBlockEnd:   ''
98 118
 MaxEmptyLinesToKeep: 1
... ...
@@ -102,47 +147,78 @@ ObjCBlockIndentWidth: 2
102 102
 ObjCBreakBeforeNestedBlockParam: true
103 103
 ObjCSpaceAfterProperty: false
104 104
 ObjCSpaceBeforeProtocolList: true
105
+PackConstructorInitializers: BinPack
105 106
 PenaltyBreakAssignment: 2
106 107
 PenaltyBreakBeforeFirstCallParameter: 19
107 108
 PenaltyBreakComment: 300
108 109
 PenaltyBreakFirstLessLess: 120
110
+PenaltyBreakOpenParenthesis: 0
109 111
 PenaltyBreakString: 1000
110 112
 PenaltyBreakTemplateDeclaration: 10
111 113
 PenaltyExcessCharacter: 1000000
114
+PenaltyIndentedWhitespace: 0
112 115
 PenaltyReturnTypeOnItsOwnLine: 60
113 116
 PointerAlignment: Right
117
+PPIndentWidth:   -1
118
+QualifierAlignment: Leave
119
+ReferenceAlignment: Pointer
114 120
 ReflowComments:  true
115
-SortIncludes:    false
116
-SortUsingDeclarations: true
121
+RemoveBracesLLVM: false
122
+RemoveSemicolon: false
123
+RequiresClausePosition: OwnLine
124
+RequiresExpressionIndentation: OuterScope
125
+SeparateDefinitionBlocks: Leave
126
+ShortNamespaceLines: 1
127
+SortIncludes:    Never
128
+SortJavaStaticImport: Before
129
+SortUsingDeclarations: LexicographicNumeric
117 130
 SpaceAfterCStyleCast: false
118 131
 SpaceAfterLogicalNot: false
119 132
 SpaceAfterTemplateKeyword: true
133
+SpaceAroundPointerQualifiers: Default
120 134
 SpaceBeforeAssignmentOperators: true
135
+SpaceBeforeCaseColon: false
121 136
 SpaceBeforeCpp11BracedList: false
122 137
 SpaceBeforeCtorInitializerColon: true
123 138
 SpaceBeforeInheritanceColon: true
124 139
 SpaceBeforeParens: ControlStatements
140
+SpaceBeforeParensOptions:
141
+  AfterControlStatements: true
142
+  AfterForeachMacros: true
143
+  AfterFunctionDefinitionName: false
144
+  AfterFunctionDeclarationName: false
145
+  AfterIfMacros:   true
146
+  AfterOverloadedOperator: false
147
+  AfterRequiresInClause: false
148
+  AfterRequiresInExpression: false
149
+  BeforeNonEmptyParentheses: false
125 150
 SpaceBeforeRangeBasedForLoopColon: true
151
+SpaceBeforeSquareBrackets: false
126 152
 SpaceInEmptyBlock: false
127 153
 SpaceInEmptyParentheses: false
128 154
 SpacesBeforeTrailingComments: 1
129
-SpacesInAngles:  false
155
+SpacesInAngles:  Never
130 156
 SpacesInConditionalStatement: false
131 157
 SpacesInContainerLiterals: true
132 158
 SpacesInCStyleCastParentheses: false
159
+SpacesInLineCommentPrefix:
160
+  Minimum:         1
161
+  Maximum:         -1
133 162
 SpacesInParentheses: false
134 163
 SpacesInSquareBrackets: false
135
-SpaceBeforeSquareBrackets: false
136 164
 Standard:        Latest
165
+StatementAttributeLikeMacros:
166
+  - Q_EMIT
137 167
 StatementMacros:
138 168
   - Q_UNUSED
139 169
   - QT_REQUIRE_VERSION
140 170
 TabWidth:        8
141
-UseCRLF:         false
142 171
 UseTab:          Never
143 172
 WhitespaceSensitiveMacros:
144
-  - STRINGIZE
145
-  - PP_STRINGIZE
146 173
   - BOOST_PP_STRINGIZE
174
+  - CF_SWIFT_NAME
175
+  - NS_SWIFT_NAME
176
+  - PP_STRINGIZE
177
+  - STRINGIZE
147 178
 ...
148 179
 
... ...
@@ -60,6 +60,6 @@ jobs:
60 60
       - name: Run clang-format style check for C/C++ programs.
61 61
         uses: jidicula/clang-format-action@v4.4.1
62 62
         with:
63
-          clang-format-version: "14"
63
+          clang-format-version: "16"
64 64
           check-path: ${{ matrix.path['check'] }}
65 65
           exclude-regex: ${{ matrix.path['exclude'] }}
... ...
@@ -1,54 +1,54 @@
1 1
 #!/bin/bash
2 2
 
3
-clang-format -style='{ Language: Cpp, UseTab: Never, IndentWidth: 4, AlignTrailingComments: true, AlignConsecutiveAssignments: true, AlignAfterOpenBracket: true, AlignEscapedNewlines: Left, AlignOperands: true, AllowShortFunctionsOnASingleLine: Empty, AllowShortIfStatementsOnASingleLine: true, AllowShortLoopsOnASingleLine: true, BreakBeforeBraces: Linux, BreakBeforeTernaryOperators: true, ColumnLimit: 0, FixNamespaceComments: true, SortIncludes: false, MaxEmptyLinesToKeep: 1, SpaceBeforeParens: ControlStatements, IndentCaseLabels: true, DerivePointerAlignment: true }' -dump-config > .clang-format
3
+clang-format-16 -style='{ Language: Cpp, UseTab: Never, IndentWidth: 4, AlignTrailingComments: true, AlignConsecutiveAssignments: true, AlignAfterOpenBracket: true, AlignEscapedNewlines: Left, AlignOperands: true, AllowShortFunctionsOnASingleLine: Empty, AllowShortIfStatementsOnASingleLine: true, AllowShortLoopsOnASingleLine: true, BreakBeforeBraces: Linux, BreakBeforeTernaryOperators: true, ColumnLimit: 0, FixNamespaceComments: true, SortIncludes: false, MaxEmptyLinesToKeep: 1, SpaceBeforeParens: ControlStatements, IndentCaseLabels: true, DerivePointerAlignment: true }' -dump-config > .clang-format
4 4
 
5
-clang-format -i -verbose clamav-milter/*.c
6
-clang-format -i -verbose clamav-milter/*.h
7
-clang-format -i -verbose clambc/*.c
8
-clang-format -i -verbose clambc/*.h
9
-clang-format -i -verbose clamconf/*.c
10
-clang-format -i -verbose clamconf/*.h
11
-clang-format -i -verbose clamd/*.c
12
-clang-format -i -verbose clamd/*.h
13
-clang-format -i -verbose clamdscan/*.c
14
-clang-format -i -verbose clamdscan/*.h
15
-clang-format -i -verbose clamdtop/*.c
16
-clang-format -i -verbose clamdtop/*.h
17
-clang-format -i -verbose clamscan/*.c
18
-clang-format -i -verbose clamscan/*.h
19
-clang-format -i -verbose clamsubmit/*.c
20
-clang-format -i -verbose clamsubmit/*.h
21
-clang-format -i -verbose examples/*.c
22
-clang-format -i -verbose examples/*.h
23
-clang-format -i -verbose examples/fileprop_analysis/*.c
24
-clang-format -i -verbose examples/fileprop_analysis/old/*.c
25
-clang-format -i -verbose freshclam/*.c
26
-clang-format -i -verbose freshclam/*.h
27
-clang-format -i -verbose libclamav/*.c
28
-clang-format -i -verbose libclamav/*.h
29
-clang-format -i -verbose libclamav/jsparse/*.c
30
-clang-format -i -verbose libclamav/jsparse/*.h
31
-clang-format -i -verbose libclamav/lzw/*.c
32
-clang-format -i -verbose libclamav/lzw/*.h
33
-clang-format -i -verbose libclamav/nsis/nulsft.*
34
-clang-format -i -verbose libclamav/c++/*.cpp
35
-clang-format -i -verbose libclamav/c++/*.h
36
-clang-format -i -verbose libclamunrar_iface/*.cpp
37
-clang-format -i -verbose libclamunrar_iface/*.h
38
-clang-format -i -verbose libfreshclam/*.c
39
-clang-format -i -verbose libfreshclam/*.h
40
-clang-format -i -verbose common/*.c
41
-clang-format -i -verbose common/*.h
42
-clang-format -i -verbose sigtool/*.c
43
-clang-format -i -verbose sigtool/*.h
44
-clang-format -i -verbose clamonacc/*.c
45
-clang-format -i -verbose clamonacc/*.h
46
-clang-format -i -verbose clamonacc/*/*.c
47
-clang-format -i -verbose clamonacc/*/*.h
48
-clang-format -i -verbose unit_tests/*.c
49
-clang-format -i -verbose unit_tests/*.h
50
-clang-format -i -verbose win32/compat/*.c
51
-clang-format -i -verbose win32/compat/*.h
5
+clang-format-16 -i -verbose clamav-milter/*.c
6
+clang-format-16 -i -verbose clamav-milter/*.h
7
+clang-format-16 -i -verbose clambc/*.c
8
+clang-format-16 -i -verbose clambc/*.h
9
+clang-format-16 -i -verbose clamconf/*.c
10
+clang-format-16 -i -verbose clamconf/*.h
11
+clang-format-16 -i -verbose clamd/*.c
12
+clang-format-16 -i -verbose clamd/*.h
13
+clang-format-16 -i -verbose clamdscan/*.c
14
+clang-format-16 -i -verbose clamdscan/*.h
15
+clang-format-16 -i -verbose clamdtop/*.c
16
+clang-format-16 -i -verbose clamdtop/*.h
17
+clang-format-16 -i -verbose clamscan/*.c
18
+clang-format-16 -i -verbose clamscan/*.h
19
+clang-format-16 -i -verbose clamsubmit/*.c
20
+clang-format-16 -i -verbose clamsubmit/*.h
21
+clang-format-16 -i -verbose examples/*.c
22
+clang-format-16 -i -verbose examples/*.h
23
+clang-format-16 -i -verbose examples/fileprop_analysis/*.c
24
+clang-format-16 -i -verbose examples/fileprop_analysis/old/*.c
25
+clang-format-16 -i -verbose freshclam/*.c
26
+clang-format-16 -i -verbose freshclam/*.h
27
+clang-format-16 -i -verbose libclamav/*.c
28
+clang-format-16 -i -verbose libclamav/*.h
29
+clang-format-16 -i -verbose libclamav/jsparse/*.c
30
+clang-format-16 -i -verbose libclamav/jsparse/*.h
31
+clang-format-16 -i -verbose libclamav/lzw/*.c
32
+clang-format-16 -i -verbose libclamav/lzw/*.h
33
+clang-format-16 -i -verbose libclamav/nsis/nulsft.*
34
+clang-format-16 -i -verbose libclamav/c++/*.cpp
35
+clang-format-16 -i -verbose libclamav/c++/*.h
36
+clang-format-16 -i -verbose libclamunrar_iface/*.cpp
37
+clang-format-16 -i -verbose libclamunrar_iface/*.h
38
+clang-format-16 -i -verbose libfreshclam/*.c
39
+clang-format-16 -i -verbose libfreshclam/*.h
40
+clang-format-16 -i -verbose common/*.c
41
+clang-format-16 -i -verbose common/*.h
42
+clang-format-16 -i -verbose sigtool/*.c
43
+clang-format-16 -i -verbose sigtool/*.h
44
+clang-format-16 -i -verbose clamonacc/*.c
45
+clang-format-16 -i -verbose clamonacc/*.h
46
+clang-format-16 -i -verbose clamonacc/*/*.c
47
+clang-format-16 -i -verbose clamonacc/*/*.h
48
+clang-format-16 -i -verbose unit_tests/*.c
49
+clang-format-16 -i -verbose unit_tests/*.h
50
+clang-format-16 -i -verbose win32/compat/*.c
51
+clang-format-16 -i -verbose win32/compat/*.h
52 52
 
53 53
 # Undo changes to specific files that we don't really want to reformat
54 54
 git checkout libclamav/iana_cctld.h