From 12c56318a8c0e53cfcaa7d592654dc7a2c3e9daa Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 13 Feb 2023 15:44:46 +0300 Subject: [PATCH] Update clang-format to 16.0.0. --- .clang-format | 82 +++++++++++++++++++++++++++++-------- telegram-bot-api/Client.cpp | 2 +- 2 files changed, 65 insertions(+), 19 deletions(-) diff --git a/.clang-format b/.clang-format index 4e23f1d..8f0a588 100644 --- a/.clang-format +++ b/.clang-format @@ -4,15 +4,36 @@ Language: Cpp AccessModifierOffset: -1 AlignAfterOpenBracket: Align AlignArrayOfStructures: None -AlignConsecutiveMacros: None -AlignConsecutiveAssignments: None -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: None +AlignConsecutiveAssignments: + Enabled: 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 AlignOperands: Align -AlignTrailingComments: true +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 AllowAllArgumentsOnNextLine: true -AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false @@ -25,6 +46,8 @@ AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: Yes +# AttributeMacros: +# - __capability BinPackArguments: true BinPackParameters: true BitFieldColonSpacing: Both @@ -33,12 +56,12 @@ BraceWrapping: AfterClass: false AfterControlStatement: Never AfterEnum: false + AfterExternBlock: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false - AfterExternBlock: false BeforeCatch: false BeforeElse: false BeforeLambdaBody: false @@ -47,24 +70,23 @@ BraceWrapping: SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true +BreakAfterAttributes: Never +# BreakAfterJavaFieldAnnotations: false +BreakArrays: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Attach -BreakBeforeConceptDeclarations: true -BreakBeforeInheritanceComma: true # false -BreakInheritanceList: BeforeComma # BeforeColon +BreakBeforeConceptDeclarations: Always +BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: true # false BreakConstructorInitializers: BeforeComma # BeforeColon -# BreakAfterJavaFieldAnnotations: false +BreakInheritanceList: BeforeComma # BeforeColon BreakStringLiterals: true ColumnLimit: 120 # 80 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true -DeriveLineEnding: true DerivePointerAlignment: true DisableFormat: false EmptyLineAfterAccessModifier: Never @@ -83,14 +105,21 @@ IndentCaseLabels: true IndentExternBlock: AfterExternBlock IndentGotoLabels: true IndentPPDirectives: None -IndentRequires: false +IndentRequiresClause: true IndentWidth: 2 IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: false # InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + Decimal: 0 + Hex: 0 # JavaScriptQuotes: Leave # JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false LambdaBodyIndentation: Signature +LineEnding: DeriveLF MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 @@ -100,23 +129,31 @@ NamespaceIndentation: None # ObjCBreakBeforeNestedBlockParam: true # ObjCSpaceAfterProperty: false # ObjCSpaceBeforeProtocolList: true +PackConstructorInitializers: NextLine PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyIndentedWhitespace: 0 PenaltyReturnTypeOnItsOwnLine: 200 -PointerAlignment: Right +PointerAlignment: Right # Left PPIndentWidth: -1 +QualifierAlignment: Leave ReferenceAlignment: Pointer ReflowComments: false # true +RemoveBracesLLVM: false +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Leave ShortNamespaceLines: 0 # 1 SortIncludes: CaseInsensitive # CaseSensitive # SortJavaStaticImport: Before -SortUsingDeclarations: false # true +SortUsingDeclarations: Lexicographic # LexicographicNumeric SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true @@ -127,6 +164,16 @@ SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false SpaceBeforeRangeBasedForLoopColon: true SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false @@ -143,6 +190,5 @@ SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Auto TabWidth: 100 # 8 -UseCRLF: false UseTab: Never ... diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 8b62bf5..76ef68c 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -36,8 +36,8 @@ namespace telegram_bot_api { using td::Jsonable; -using td::JsonValueScope; using td::JsonValue; +using td::JsonValueScope; using td_api::make_object; using td_api::move_object_as;