From 59562cb4a9fd035f3bd20bb90dc6b5d9dd85ecb4 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 21 Feb 2026 19:36:17 +0000 Subject: [PATCH] meta: add clang-format config --- clang-format/clang-format | 49 +++++++++++++++++++++++++++++++++++++++ meta/components.json | 6 +++++ 2 files changed, 55 insertions(+) create mode 100644 clang-format/clang-format diff --git a/clang-format/clang-format b/clang-format/clang-format new file mode 100644 index 0000000..d646189 --- /dev/null +++ b/clang-format/clang-format @@ -0,0 +1,49 @@ +BasedOnStyle: WebKit +IndentWidth: 8 +--- +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: false +BinPackParameters: false +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: 1000 diff --git a/meta/components.json b/meta/components.json index bfcb11d..b8e2dba 100644 --- a/meta/components.json +++ b/meta/components.json @@ -5,6 +5,12 @@ { "source": "init.zsh", "dest": ".zshrc" } ] }, + { + "name": "clang-format", + "link-files": [ + { "source": "clang-format", "dest": ".clang-format" } + ] + }, { "name": "nvim", "link-dirs": [