Explicitly set clang-format version to 16

This commit is contained in:
ragusaa 2024-04-03 16:35:23 -04:00 committed by GitHub
parent b8691543db
commit ae37b2216b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 152 additions and 76 deletions

View file

@ -2,40 +2,65 @@
Language: Cpp Language: Cpp
AccessModifierOffset: -2 AccessModifierOffset: -2
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false AlignArrayOfStructures: None
AlignConsecutiveAssignments: true AlignConsecutiveAssignments:
AlignConsecutiveBitFields: false Enabled: true
AlignConsecutiveDeclarations: false AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Left AlignEscapedNewlines: Left
AlignOperands: Align AlignOperands: Align
AlignTrailingComments: true AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true BinPackArguments: true
BinPackParameters: true BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping: BraceWrapping:
AfterCaseLabel: false AfterCaseLabel: false
AfterClass: true AfterClass: true
AfterControlStatement: Never AfterControlStatement: Never
AfterEnum: false AfterEnum: false
AfterExternBlock: false
AfterFunction: true AfterFunction: true
AfterNamespace: true AfterNamespace: true
AfterObjCDeclaration: false AfterObjCDeclaration: false
AfterStruct: false AfterStruct: false
AfterUnion: false AfterUnion: false
AfterExternBlock: false
BeforeCatch: false BeforeCatch: false
BeforeElse: false BeforeElse: false
BeforeLambdaBody: false BeforeLambdaBody: false
@ -44,55 +69,75 @@ BraceWrapping:
SplitEmptyFunction: true SplitEmptyFunction: true
SplitEmptyRecord: true SplitEmptyRecord: true
SplitEmptyNamespace: true SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None BreakAfterAttributes: Never
BreakBeforeBraces: Linux
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false BreakAfterJavaFieldAnnotations: false
BreakArrays: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Linux
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true BreakStringLiterals: true
ColumnLimit: 0 ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:' CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4 ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4 ContinuationIndentWidth: 4
Cpp11BracedListStyle: true Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true DerivePointerAlignment: true
DisableFormat: false DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true FixNamespaceComments: true
ForEachMacros: ForEachMacros:
- foreach - foreach
- Q_FOREACH - Q_FOREACH
- BOOST_FOREACH - BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve IncludeBlocks: Preserve
IncludeCategories: IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2 Priority: 2
SortPriority: 0 SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)' - Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3 Priority: 3
SortPriority: 0 SortPriority: 0
CaseSensitive: false
- Regex: '.*' - Regex: '.*'
Priority: 1 Priority: 1
SortPriority: 0 SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$' IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: '' IncludeIsMainSourceRegex: ''
IndentCaseLabels: true IndentAccessModifiers: false
IndentCaseBlocks: false IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true IndentGotoLabels: true
IndentPPDirectives: None IndentPPDirectives: None
IndentExternBlock: AfterExternBlock IndentRequiresClause: true
IndentWidth: 4 IndentWidth: 4
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave JavaScriptQuotes: Leave
JavaScriptWrapImports: true JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1
@ -102,47 +147,78 @@ ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2 PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300 PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120 PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000 PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10 PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000 PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60 PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right PointerAlignment: Right
PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: true ReflowComments: true
SortIncludes: false RemoveBracesLLVM: false
SortUsingDeclarations: true RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: Never
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1 SpacesBeforeTrailingComments: 1
SpacesInAngles: false SpacesInAngles: Never
SpacesInConditionalStatement: false SpacesInConditionalStatement: false
SpacesInContainerLiterals: true SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false SpacesInParentheses: false
SpacesInSquareBrackets: false SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros: StatementMacros:
- Q_UNUSED - Q_UNUSED
- QT_REQUIRE_VERSION - QT_REQUIRE_VERSION
TabWidth: 8 TabWidth: 8
UseCRLF: false
UseTab: Never UseTab: Never
WhitespaceSensitiveMacros: WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE - BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
... ...

View file

@ -60,6 +60,6 @@ jobs:
- name: Run clang-format style check for C/C++ programs. - name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.4.1 uses: jidicula/clang-format-action@v4.4.1
with: with:
clang-format-version: "14" clang-format-version: "16"
check-path: ${{ matrix.path['check'] }} check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }} exclude-regex: ${{ matrix.path['exclude'] }}

View file

@ -1,54 +1,54 @@
#!/bin/bash #!/bin/bash
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 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
clang-format -i -verbose clamav-milter/*.c clang-format-16 -i -verbose clamav-milter/*.c
clang-format -i -verbose clamav-milter/*.h clang-format-16 -i -verbose clamav-milter/*.h
clang-format -i -verbose clambc/*.c clang-format-16 -i -verbose clambc/*.c
clang-format -i -verbose clambc/*.h clang-format-16 -i -verbose clambc/*.h
clang-format -i -verbose clamconf/*.c clang-format-16 -i -verbose clamconf/*.c
clang-format -i -verbose clamconf/*.h clang-format-16 -i -verbose clamconf/*.h
clang-format -i -verbose clamd/*.c clang-format-16 -i -verbose clamd/*.c
clang-format -i -verbose clamd/*.h clang-format-16 -i -verbose clamd/*.h
clang-format -i -verbose clamdscan/*.c clang-format-16 -i -verbose clamdscan/*.c
clang-format -i -verbose clamdscan/*.h clang-format-16 -i -verbose clamdscan/*.h
clang-format -i -verbose clamdtop/*.c clang-format-16 -i -verbose clamdtop/*.c
clang-format -i -verbose clamdtop/*.h clang-format-16 -i -verbose clamdtop/*.h
clang-format -i -verbose clamscan/*.c clang-format-16 -i -verbose clamscan/*.c
clang-format -i -verbose clamscan/*.h clang-format-16 -i -verbose clamscan/*.h
clang-format -i -verbose clamsubmit/*.c clang-format-16 -i -verbose clamsubmit/*.c
clang-format -i -verbose clamsubmit/*.h clang-format-16 -i -verbose clamsubmit/*.h
clang-format -i -verbose examples/*.c clang-format-16 -i -verbose examples/*.c
clang-format -i -verbose examples/*.h clang-format-16 -i -verbose examples/*.h
clang-format -i -verbose examples/fileprop_analysis/*.c clang-format-16 -i -verbose examples/fileprop_analysis/*.c
clang-format -i -verbose examples/fileprop_analysis/old/*.c clang-format-16 -i -verbose examples/fileprop_analysis/old/*.c
clang-format -i -verbose freshclam/*.c clang-format-16 -i -verbose freshclam/*.c
clang-format -i -verbose freshclam/*.h clang-format-16 -i -verbose freshclam/*.h
clang-format -i -verbose libclamav/*.c clang-format-16 -i -verbose libclamav/*.c
clang-format -i -verbose libclamav/*.h clang-format-16 -i -verbose libclamav/*.h
clang-format -i -verbose libclamav/jsparse/*.c clang-format-16 -i -verbose libclamav/jsparse/*.c
clang-format -i -verbose libclamav/jsparse/*.h clang-format-16 -i -verbose libclamav/jsparse/*.h
clang-format -i -verbose libclamav/lzw/*.c clang-format-16 -i -verbose libclamav/lzw/*.c
clang-format -i -verbose libclamav/lzw/*.h clang-format-16 -i -verbose libclamav/lzw/*.h
clang-format -i -verbose libclamav/nsis/nulsft.* clang-format-16 -i -verbose libclamav/nsis/nulsft.*
clang-format -i -verbose libclamav/c++/*.cpp clang-format-16 -i -verbose libclamav/c++/*.cpp
clang-format -i -verbose libclamav/c++/*.h clang-format-16 -i -verbose libclamav/c++/*.h
clang-format -i -verbose libclamunrar_iface/*.cpp clang-format-16 -i -verbose libclamunrar_iface/*.cpp
clang-format -i -verbose libclamunrar_iface/*.h clang-format-16 -i -verbose libclamunrar_iface/*.h
clang-format -i -verbose libfreshclam/*.c clang-format-16 -i -verbose libfreshclam/*.c
clang-format -i -verbose libfreshclam/*.h clang-format-16 -i -verbose libfreshclam/*.h
clang-format -i -verbose common/*.c clang-format-16 -i -verbose common/*.c
clang-format -i -verbose common/*.h clang-format-16 -i -verbose common/*.h
clang-format -i -verbose sigtool/*.c clang-format-16 -i -verbose sigtool/*.c
clang-format -i -verbose sigtool/*.h clang-format-16 -i -verbose sigtool/*.h
clang-format -i -verbose clamonacc/*.c clang-format-16 -i -verbose clamonacc/*.c
clang-format -i -verbose clamonacc/*.h clang-format-16 -i -verbose clamonacc/*.h
clang-format -i -verbose clamonacc/*/*.c clang-format-16 -i -verbose clamonacc/*/*.c
clang-format -i -verbose clamonacc/*/*.h clang-format-16 -i -verbose clamonacc/*/*.h
clang-format -i -verbose unit_tests/*.c clang-format-16 -i -verbose unit_tests/*.c
clang-format -i -verbose unit_tests/*.h clang-format-16 -i -verbose unit_tests/*.h
clang-format -i -verbose win32/compat/*.c clang-format-16 -i -verbose win32/compat/*.c
clang-format -i -verbose win32/compat/*.h clang-format-16 -i -verbose win32/compat/*.h
# Undo changes to specific files that we don't really want to reformat # Undo changes to specific files that we don't really want to reformat
git checkout libclamav/iana_cctld.h git checkout libclamav/iana_cctld.h