From c03d6e215a571309cba98eaacba8c5f76584d422 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Fri, 9 Feb 2024 18:57:15 -0500 Subject: [PATCH] feat: auto-formatting with `clang-format` --- .clang-format | 49 ++++++++++++++++++++++++++++++++++++++++++++ .clang-format-ignore | 1 + 2 files changed, 50 insertions(+) create mode 100644 .clang-format create mode 100644 .clang-format-ignore diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..88c79367 --- /dev/null +++ b/.clang-format @@ -0,0 +1,49 @@ +--- +BasedOnStyle: LLVM +Standard: Auto +ColumnLimit: 0 + +# parentheses, braces, etc. +Cpp11BracedListStyle: true +SpaceAfterControlStatementKeyword: false +BreakConstructorInitializersBeforeComma: true +FixNamespaceComments: false +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: MultiLine + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: true + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false + +# alignment +PointerAlignment: Left +ReferenceAlignment: Left +NamespaceIndentation: All +AlignConsecutiveAssignments: true +AlignTrailingComments: false + +# indentation +UseTab: Never +IndentAccessModifiers: true + +# empty lines +KeepEmptyLinesAtTheStartOfBlocks: true +MaxEmptyLinesToKeep: 2 +SeparateDefinitionBlocks: Leave +EmptyLineAfterAccessModifier: Leave +EmptyLineBeforeAccessModifier: Leave + +# linebreaks +AllowShortEnumsOnASingleLine: true +... diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 00000000..cd32ec61 --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1 @@ +examples/build_with_*/*.cc