From 4e5d10b130fa2279df360577469e629bd889dc47 Mon Sep 17 00:00:00 2001 From: AMS21 Date: Sat, 4 Nov 2023 10:00:08 +0100 Subject: [PATCH] Update `.clang-format` style --- src/.clang-format | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/.clang-format b/src/.clang-format index 0e0bb1909ae..bf8375caf0c 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -1,5 +1,7 @@ --- Language: Cpp +Standard: c++17 + AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false @@ -9,8 +11,10 @@ AlignTrailingComments: false AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: true +AllowShortEnumsOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: true AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None @@ -19,6 +23,7 @@ AlwaysBreakTemplateDeclarations: Yes BinPackArguments: true BinPackParameters: true BraceWrapping: + AfterCaseLabel: true AfterClass: true AfterControlStatement: Always AfterEnum: true @@ -30,18 +35,26 @@ BraceWrapping: BeforeCatch: true BeforeElse: true IndentBraces: false + SplitEmptyFunction: false + SplitEmptyNamespace: false + SplitEmptyRecord: false +BreakAfterAttributes: Never BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BreakBeforeTernaryOperators: false -BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeComma ColumnLimit: 120 CommentPragmas: '^ (IWYU pragma:|NOLINT)' +CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: Always +FixNamespaceComments: true ForEachMacros: [ ] IncludeCategories: - Regex: 'stdafx.h' @@ -51,8 +64,11 @@ IncludeCategories: - Regex: '^"' Priority: 2 IndentCaseLabels: false +IndentPPDirectives: None IndentWidth: 4 IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: true KeepEmptyLinesAtTheStartOfBlocks: false MacroBlockBegin: '' MacroBlockEnd: '' @@ -68,19 +84,29 @@ PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Left +QualifierAlignment: Left +ReferenceAlignment: Left ReflowComments: true -SortIncludes: false +RemoveBracesLLVM: true +RemoveParentheses: Leave +SortIncludes: true SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceAroundPointerQualifiers: Before SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: false +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false SpacesBeforeTrailingComments: 1 -SpacesInAngles: false +SpacesInAngles: Never SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false -SpacesInParentheses: false +SpacesInParens: Never SpacesInSquareBrackets: false -Standard: c++11 TabWidth: 4 UseTab: Never ...