From ea0beba9576e0c50d508c0cd6682987d9473e738 Mon Sep 17 00:00:00 2001 From: angie Date: Sat, 1 Jun 2024 09:54:30 -0400 Subject: [PATCH] clang format file --- .clang-format | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..1574fd1 --- /dev/null +++ b/.clang-format @@ -0,0 +1,60 @@ +IndentWidth: 4 +Language: Cpp +UseTab: Never +ColumnLimit: 140 +ReferenceAlignment: Left +PointerAlignment: Right +SpaceAfterCStyleCast: false +Cpp11BracedListStyle: false +SpaceBeforeCpp11BracedList: false + +# Cases inside switches are indented one level +IndentCaseLabels: true + +# Do not indent access modifiers (public, protected, private) +AccessModifierOffset: -4 + +AlignAfterOpenBracket: AlwaysBreak + +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: false +AllowShortLoopsOnASingleLine: false + +# Otherwise it would align escaped newlines to the column limit +AlignEscapedNewlines: Left + +AlignTrailingComments: true +SortIncludes: true + +BreakBeforeBraces: Custom +BraceWrapping: + AfterControlStatement: Never + AfterFunction: false + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeElse: true + +# Adds a comment at the end of the namespace with its name +FixNamespaceComments: true +# Indent namespace's content +NamespaceIndentation: All + +# Aligns preprocessor directives +IndentPPDirectives: AfterHash + +# No space between template and < +SpaceAfterTemplateKeyword: false +# Newline after template +AlwaysBreakTemplateDeclarations: Yes + +# Make the indentation of lambdas nicer +LambdaBodyIndentation: Signature + +# Tags these macros as types +TypenameMacros: ["PTR"]