From facc73319b4199e42e5fda9cc1bae29cff05b45a Mon Sep 17 00:00:00 2001 From: dreamsyntax Date: Fri, 3 Nov 2023 20:03:36 -0700 Subject: [PATCH] Update .clang-format/.editorconfig --- .editorconfig | 11 ++++- Source/.clang-format | 95 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 90 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3e11a8e9..4e074ee7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,9 +2,16 @@ root = true [*] charset = utf-8 +indent_size = 2 +trim_trailing_whitespace = true [*.{h,cpp}] indent_style = space -indent_size = 2 insert_final_newline = true -trim_trailing_whitespace = true +max_line_length = 100 + +[{CMakeLists.txt,*.cmake}] +indent_style = tab + +[.editorconfig] +insert_final_newline = true \ No newline at end of file diff --git a/Source/.clang-format b/Source/.clang-format index a914852a..b4ec493b 100755 --- a/Source/.clang-format +++ b/Source/.clang-format @@ -1,17 +1,84 @@ ---- -AlignAfterOpenBracket: 'true' -AllowAllParametersOfDeclarationOnNextLine: 'true' -AllowShortFunctionsOnASingleLine: None -AlwaysBreakBeforeMultilineStrings: 'true' -AlwaysBreakTemplateDeclarations: 'true' -BreakBeforeBraces: Allman -BreakStringLiterals: 'true' -FixNamespaceComments: 'true' -ColumnLimit: '100' -Cpp11BracedListStyle: 'true' -Language: Cpp +--- +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlinesLeft: false +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: InlineOnly +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + IndentBraces: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: false +ColumnLimit: 100 +CommentPragmas: '^ (IWYU pragma:|NOLINT)' +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ForEachMacros: [] +IncludeCategories: + - Regex: '^<[Ww]indows\.h>$' + Priority: 1 + - Regex: '^<' + Priority: 2 + - Regex: '^"' + Priority: 3 +IndentCaseLabels: false +IndentWidth: 2 +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Left -Standard: Cpp11 -UseTab: Never +ReflowComments: true +SortIncludes: true +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Latest +TabWidth: 2 +UseTab: Never ...