From 9df79f90a60776d0fdc5c4075534b5b1621285f3 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 11 Jan 2026 14:51:49 +0000 Subject: [PATCH] meta: add clang-format config --- .clang-format | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..5bfc94b --- /dev/null +++ b/.clang-format @@ -0,0 +1,174 @@ +BasedOnStyle: WebKit +IndentWidth: 8 +--- +Language: C +DerivePointerAlignment: false +PointerAlignment: Right +ColumnLimit: 80 +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: AcrossEmptyLinesAndComments +AlignEscapedNewlines: Right +AlignOperands: AlignAfterOperator +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +ExperimentalAutoDetectBinPacking: false +BitFieldColonSpacing: Both +BreakBeforeBraces: Linux +BreakBeforeBinaryOperators: All +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma +BreakStringLiterals: true +ContinuationIndentWidth: 8 +Cpp11BracedListStyle: true +IncludeBlocks: Regroup +SortIncludes: true +IndentRequires: true +NamespaceIndentation: Inner +ReflowComments: true +SpacesBeforeTrailingComments: 3 +TabWidth: 8 +UseTab: AlignWithSpaces +PenaltyReturnTypeOnItsOwnLine: 1000000 +PenaltyExcessCharacter: 5 +PenaltyBreakOpenParenthesis: 5 +PenaltyBreakBeforeFirstCallParameter: 5 +PenaltyIndentedWhitespace: 0 +AttributeMacros: + - BLUELIB_API +ForEachMacros: + - b_btree_foreach + - b_queue_foreach +MacroBlockBegin: "MIE_.*_BEGIN" +MacroBlockEnd: "MIE_.*_END" +--- +Language: Cpp +DerivePointerAlignment: false +PointerAlignment: Right +ColumnLimit: 80 +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: AcrossEmptyLinesAndComments +AlignEscapedNewlines: Right +AlignOperands: AlignAfterOperator +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +ExperimentalAutoDetectBinPacking: false +BitFieldColonSpacing: Both +BreakBeforeBraces: Linux +BreakBeforeBinaryOperators: All +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma +BreakStringLiterals: true +ContinuationIndentWidth: 8 +Cpp11BracedListStyle: true +IncludeBlocks: Regroup +SortIncludes: true +IndentRequires: true +NamespaceIndentation: Inner +ReflowComments: true +SpacesBeforeTrailingComments: 3 +TabWidth: 8 +UseTab: AlignWithSpaces +PenaltyReturnTypeOnItsOwnLine: 1000000 +PenaltyExcessCharacter: 5 +PenaltyBreakOpenParenthesis: 5 +PenaltyBreakBeforeFirstCallParameter: 5 +PenaltyIndentedWhitespace: 0 +AttributeMacros: + - BLUELIB_API +ForEachMacros: + - b_btree_foreach + - b_queue_foreach +--- +Language: ObjC +DerivePointerAlignment: false +PointerAlignment: Right +ColumnLimit: 80 +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: AcrossEmptyLinesAndComments +AlignEscapedNewlines: Right +AlignOperands: AlignAfterOperator +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: false +AllowAllConstructorInitializersOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +ExperimentalAutoDetectBinPacking: false +BitFieldColonSpacing: Both +BreakBeforeBraces: Linux +BreakBeforeBinaryOperators: All +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma +BreakStringLiterals: true +ContinuationIndentWidth: 8 +Cpp11BracedListStyle: true +IncludeBlocks: Regroup +SortIncludes: true +IndentRequires: true +NamespaceIndentation: Inner +ReflowComments: true +SpacesBeforeTrailingComments: 3 +TabWidth: 8 +UseTab: AlignWithSpaces +PenaltyReturnTypeOnItsOwnLine: 1000000 +PenaltyExcessCharacter: 5 +PenaltyBreakOpenParenthesis: 5 +PenaltyBreakBeforeFirstCallParameter: 5 +PenaltyIndentedWhitespace: 0 +AttributeMacros: + - BLUELIB_API +ForEachMacros: + - b_btree_foreach + - b_queue_foreach +MacroBlockBegin: "B_TYPE_.*_BEGIN" +MacroBlockEnd: "B_TYPE_.*_END"