From 55ae4a3b86e51d80c77e631db7270c5e5a2af2fb Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 9 Nov 2025 20:17:02 +0800 Subject: mv clang-format to root --- .clang-format | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ core/.clang-format | 82 ------------------------------------------------------ 2 files changed, 82 insertions(+), 82 deletions(-) create mode 100644 .clang-format delete mode 100644 core/.clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..2fbb26713 --- /dev/null +++ b/.clang-format @@ -0,0 +1,82 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +DisableFormat: false + +# Indentation +IndentWidth: 4 +ContinuationIndentWidth: 4 +TabWidth: 4 +UseTab: Never + +# Braces +BreakBeforeBraces: Attach + +# Alignment +AlignAfterOpenBracket: Align +AlignTrailingComments: true +AlignConsecutiveAssignments: Consecutive +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: Consecutive +AlignConsecutiveMacros: None + +# Spacing +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpacesBeforeTrailingComments: 1 + +# Column limit +ColumnLimit: 120 + +# Short constructs +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false + +# Line breaking +AlwaysBreakAfterReturnType: None +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: true + +# Functions +IndentWrappedFunctionNames: false +MaxEmptyLinesToKeep: 1 + +# Includes +IncludeBlocks: Preserve +SortIncludes: Never + +# Initializers +AllowAllConstructorInitializersOnNextLine: true +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +Cpp11BracedListStyle: false +BinPackArguments: false +BinPackParameters: false + +# Preprocessor/Macros +IndentPPDirectives: None + +# Misc +KeepEmptyLinesAtTheStartOfBlocks: false +ReflowComments: false +SeparateDefinitionBlocks: Leave + +# Penalties +PenaltyBreakAssignment: 100 +PenaltyBreakBeforeFirstCallParameter: 100 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 1000 +PenaltyBreakTemplateDeclaration: 1000 + +--- +Language: ObjC +BasedOnStyle: LLVM +DisableFormat: true diff --git a/core/.clang-format b/core/.clang-format deleted file mode 100644 index 2fbb26713..000000000 --- a/core/.clang-format +++ /dev/null @@ -1,82 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: LLVM -DisableFormat: false - -# Indentation -IndentWidth: 4 -ContinuationIndentWidth: 4 -TabWidth: 4 -UseTab: Never - -# Braces -BreakBeforeBraces: Attach - -# Alignment -AlignAfterOpenBracket: Align -AlignTrailingComments: true -AlignConsecutiveAssignments: Consecutive -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: Consecutive -AlignConsecutiveMacros: None - -# Spacing -SpaceAfterCStyleCast: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -SpacesBeforeTrailingComments: 1 - -# Column limit -ColumnLimit: 120 - -# Short constructs -AllowShortBlocksOnASingleLine: Never -AllowShortCaseLabelsOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: None -AllowShortIfStatementsOnASingleLine: Never -AllowShortLoopsOnASingleLine: false - -# Line breaking -AlwaysBreakAfterReturnType: None -BreakBeforeBinaryOperators: None -BreakBeforeTernaryOperators: true - -# Functions -IndentWrappedFunctionNames: false -MaxEmptyLinesToKeep: 1 - -# Includes -IncludeBlocks: Preserve -SortIncludes: Never - -# Initializers -AllowAllConstructorInitializersOnNextLine: true -ConstructorInitializerAllOnOneLineOrOnePerLine: true -ConstructorInitializerIndentWidth: 4 -Cpp11BracedListStyle: false -BinPackArguments: false -BinPackParameters: false - -# Preprocessor/Macros -IndentPPDirectives: None - -# Misc -KeepEmptyLinesAtTheStartOfBlocks: false -ReflowComments: false -SeparateDefinitionBlocks: Leave - -# Penalties -PenaltyBreakAssignment: 100 -PenaltyBreakBeforeFirstCallParameter: 100 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 1000 -PenaltyBreakTemplateDeclaration: 1000 - ---- -Language: ObjC -BasedOnStyle: LLVM -DisableFormat: true -- cgit v1.3.1