From f05f4b81ebcec900aea881825f3b197afa5a161b Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 23 Sep 2023 00:44:34 +0200 Subject: [PATCH] Update Clang-Format config for Clang 17 --- .clang-format | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.clang-format b/.clang-format index 7e05c1cc..4da162da 100644 --- a/.clang-format +++ b/.clang-format @@ -10,7 +10,9 @@ AlignConsecutiveDeclarations: AcrossComments AlignConsecutiveMacros: AcrossComments AlignEscapedNewlines: Right AlignOperands: Align -AlignTrailingComments: true +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Empty @@ -48,10 +50,14 @@ BraceWrapping: SplitEmptyFunction: true SplitEmptyRecord: false SplitEmptyNamespace: true +BracedInitializerIndentWidth: 4 +BreakAfterAttributes: Never BreakAfterJavaFieldAnnotations: false +BreakArrays: false BreakBeforeBinaryOperators: None BreakBeforeInheritanceComma: false BreakBeforeConceptDeclarations: Allowed +BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: AfterColon @@ -99,14 +105,21 @@ IndentWidth: 8 IndentWrappedFunctionNames: true # NOTE: New as of Clang 15, may still misbehave InsertBraces: true +InsertNewlineAtEOF: true InsertTrailingCommas: None +# C++ only, which essentially means nope, because C headers ;). +#IntegerLiteralSeparator: +# Binary: 8 #JavaImportGroups: ['com.example', 'com', 'org'] JavaScriptQuotes: Double JavaScriptWrapImports: true +KeepEmptyLinesAtEOF: false KeepEmptyLinesAtTheStartOfBlocks: false LambdaBodyIndentation: Signature +LineEnding: DeriveLF MacroBlockBegin: '' MacroBlockEnd: '' +#Macros: MaxEmptyLinesToKeep: 1 NamespaceIndentation: All #NamespaceMacros: ['TESTSUITE'] @@ -136,13 +149,17 @@ PointerAlignment: Left ReferenceAlignment: Pointer ReflowComments: false RemoveBracesLLVM: false +# NOTE: MultipleParentheses might be fun, but may misbehave +RemoveParentheses: Leave +RemoveSemicolon: true RequiresClausePosition: WithPreceding +RequiresExpressionIndentation: OuterScope # NOTE: Nice in theory, but there can be exceptions in practice ;). SeparateDefinitionBlocks: Leave ShortNamespaceLines: 1 SortIncludes: CaseSensitive SortJavaStaticImport: Before -SortUsingDeclarations: true +SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: true SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false @@ -152,11 +169,11 @@ SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: true SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 4 SpacesInAngles: Never SpacesInCStyleCastParentheses: false @@ -165,7 +182,7 @@ SpacesInContainerLiterals: true SpacesInLineCommentPrefix: Minimum: 1 Maximum: -1 -SpacesInParentheses: false +SpacesInParens: Never SpacesInSquareBrackets: false Standard: Latest StatementAttributeLikeMacros: ['emit'] @@ -173,9 +190,10 @@ StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 8 +#TypeNames: [] TypenameMacros: ['STACK_OF', 'LIST_ENTRY'] -UseCRLF: false UseTab: ForContinuationAndIndentation +VerilogBreakBetweenInstancePorts: true #WhitespaceSensitiveMacros: ['STRINGIZE', 'PP_STRINGIZE'] ...