From 3b6b4cf79cf305834ed374524f8a95e5c09cc27c Mon Sep 17 00:00:00 2001 From: Quaylyn Rimer Date: Sun, 20 Jul 2025 15:07:21 -0600 Subject: [PATCH 1/2] Add .clang-format configuration - Addresses issue #56 by adding clang-format configuration - Based on LLVM style with customizations to preserve project aesthetics - Enables AlignConsecutiveAssignments to maintain alignment preferences - Sets PointerAlignment to Right for consistency with existing code - Preserves include order and maintains 4-space indentation - Disables column limit to avoid breaking long expressions - Configuration tested to minimize changes to existing codebase --- .clang-format | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..7a8e87e4 --- /dev/null +++ b/.clang-format @@ -0,0 +1,37 @@ +# Edyn project code style configuration +# This configuration preserves the existing code aesthetic +BasedOnStyle: LLVM +IndentWidth: 4 +AccessModifierOffset: -4 +ColumnLimit: 0 +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: false +AlignOperands: false +AlignTrailingComments: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: true +BreakBeforeBraces: Attach +DerivePointerAlignment: false +PointerAlignment: Right +IncludeBlocks: Preserve +IndentCaseLabels: false +KeepEmptyLinesAtTheStartOfBlocks: true +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +SortIncludes: false +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Latest +UseTab: Never From b5ce9709a6df0873c05197f2f1126a8e4f3d6b5d Mon Sep 17 00:00:00 2001 From: xissburg Date: Sun, 3 Aug 2025 10:41:50 -0500 Subject: [PATCH 2/2] clang-format: do not add namespace comments, no space after template keyword. --- .clang-format | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.clang-format b/.clang-format index 7a8e87e4..8c469441 100644 --- a/.clang-format +++ b/.clang-format @@ -4,7 +4,7 @@ BasedOnStyle: LLVM IndentWidth: 4 AccessModifierOffset: -4 ColumnLimit: 0 -AlignConsecutiveAssignments: true +AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignOperands: false AlignTrailingComments: false @@ -19,10 +19,11 @@ IndentCaseLabels: false KeepEmptyLinesAtTheStartOfBlocks: true MaxEmptyLinesToKeep: 2 NamespaceIndentation: None +FixNamespaceComments: false SortIncludes: false SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: true +SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeCpp11BracedList: false SpaceBeforeParens: ControlStatements