From b856dff80c3e72d4ecc218025940dad20d77e989 Mon Sep 17 00:00:00 2001 From: Vladimir Chistyakov Date: Sat, 6 Jun 2026 02:32:51 +0700 Subject: [PATCH] style: update clang-format configuration --- .clang-format | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.clang-format b/.clang-format index 7538176..25803f9 100644 --- a/.clang-format +++ b/.clang-format @@ -16,11 +16,15 @@ AlignConsecutiveShortCaseStatements: AlignCaseArrows: false AlignCaseColons: false AlignEscapedNewlines: Left -AlignOperands: true -AlignTrailingComments: true +AlignOperands: Align +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 + AlignPPAndNotPP: false AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true AllowBreakBeforeNoexceptSpecifier: OnlyWithParen +AllowBreakBeforeQtProperty: true AllowShortBlocksOnASingleLine: Empty AllowShortCaseExpressionOnASingleLine: true AllowShortCaseLabelsOnASingleLine: true @@ -34,25 +38,25 @@ AllowShortNamespacesOnASingleLine: false AlwaysBreakBeforeMultilineStrings: false AttributeMacros: [] BinPackArguments: true +BinPackLongBracedList: false BinPackParameters: true BitFieldColonSpacing: Both BreakAdjacentStringLiterals: false BreakAfterAttributes: Leave -BreakAfterJavaFieldAnnotations: true BreakAfterOpenBracketBracedList: false BreakAfterOpenBracketFunction: false BreakAfterOpenBracketIf: false BreakAfterOpenBracketLoop: false BreakAfterOpenBracketSwitch: false BreakAfterReturnType: Automatic -BreakBeforeBinaryOperators: None +BreakBeforeBinaryOperators: NonAssignment BreakBeforeBraces: Attach BreakBeforeCloseBracketBracedList: false BreakBeforeCloseBracketFunction: false BreakBeforeCloseBracketIf: false BreakBeforeCloseBracketLoop: false BreakBeforeCloseBracketSwitch: false -BreakBeforeConceptDeclarations: true +BreakBeforeConceptDeclarations: Always BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTemplateCloser: true BreakBeforeTernaryOperators: true @@ -76,6 +80,7 @@ EnumTrailingComma: Leave ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: [] +IfMacros: [] IncludeBlocks: Regroup IncludeCategories: # the order of declaration matters! - Regex: '.(gtest|gmock)\/.+' @@ -85,7 +90,7 @@ IncludeCategories: # the order of declaration matters! - Regex: '".*"' Priority: 1 IncludeIsMainRegex: '(Test|-test|_test)?$' -IncludeIsMainSourceRegex: '(_impl\.hpp)$' +IncludeIsMainSourceRegex: '(Impl|_impl)\.h.*$' IndentAccessModifiers: false IndentCaseBlocks: false IndentCaseLabels: true @@ -101,8 +106,8 @@ InsertNewlineAtEOF: true InsertTrailingCommas: None IntegerLiteralSeparator: Binary: 0 - Decimal: 3 - Hex: -1 + Decimal: 0 + Hex: 0 KeepEmptyLines: AtEndOfFile: false AtStartOfBlock: false @@ -123,7 +128,7 @@ NumericLiteralCase: HexDigit: Upper Prefix: Lower Suffix: Upper -OneLineFormatOffRegex: '' +OneLineFormatOffRegex: '^// NOLINT' PPIndentWidth: 2 PackConstructorInitializers: Never PenaltyBreakAssignment: 2 @@ -132,6 +137,7 @@ PenaltyBreakBeforeMemberAccess: 0 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 1000 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 @@ -139,7 +145,7 @@ PenaltyIndentedWhitespace: 1 PenaltyReturnTypeOnItsOwnLine: 1000 PointerAlignment: Left QualifierAlignment: Custom -QualifierOrder: ['static', 'inline', 'constexpr', 'const', 'volatile', 'restrict', 'type'] +QualifierOrder: ['friend', 'inline', 'static', 'constexpr', 'const', 'volatile', 'restrict', 'type'] RawStringFormats: - Language: Cpp Delimiters: @@ -154,7 +160,7 @@ RawStringFormats: - 'PARSE_TEXT_PROTO' BasedOnStyle: google ReferenceAlignment: Left -ReflowComments: true +ReflowComments: Always RemoveBracesLLVM: false RemoveEmptyLinesInUnwrappedLines: true RemoveParentheses: ReturnStatement @@ -168,14 +174,14 @@ SortIncludes: Enabled: true IgnoreCase: true IgnoreExtension: true -SortJavaStaticImport: Before -SortUsingDeclarations: true +SortUsingDeclarations: Lexicographic SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterOperatorKeyword: false SpaceAfterTemplateKeyword: false SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true @@ -188,7 +194,7 @@ SpacesInAngles: Never SpacesInContainerLiterals: true SpacesInLineCommentPrefix: Minimum: 1 - Maximum: 1 + Maximum: -1 SpacesInParens: Never SpacesInSquareBrackets: false Standard: Latest @@ -204,6 +210,7 @@ WhitespaceSensitiveMacros: [] WrapNamespaceBodyWithEmptyLines: Leave --- Language: JavaScript +SpaceBeforeJsonColon: false SpacesInContainerLiterals: false JavaScriptQuotes: Double JavaScriptWrapImports: true