From a5781db56a25fed7c0bbe92524df1f7c7455364a Mon Sep 17 00:00:00 2001 From: Glyn Leine Date: Sat, 3 Feb 2024 21:53:33 +0100 Subject: [PATCH] clang format file --- .clang-format | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..27f84d942 --- /dev/null +++ b/.clang-format @@ -0,0 +1,75 @@ +Language: Cpp +BasedOnStyle: LLVM + +# Newlines +LineEnding: LF +InsertNewlineAtEOF: true +MaxEmptyLinesToKeep: 3 +BreakBeforeBraces: Allman +BreakConstructorInitializers: AfterColon +BreakInheritanceList: AfterColon +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave +BreakBeforeConceptDeclarations: Always + +# General rules +InsertBraces: true +PointerAlignment: Left +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: None +ColumnLimit: 0 +AllowShortFunctionsOnASingleLine: Inline + +# Indentation: use 4 spaces for all indentation +UseTab: ForContinuationAndIndentation +TabWidth: 4 +IndentWidth: 4 +ContinuationIndentWidth: 4 +ConstructorInitializerIndentWidth: 4 +AccessModifierOffset: -4 +IndentCaseLabels: true +AlwaysBreakTemplateDeclarations: Yes +IndentPPDirectives: BeforeHash +LambdaBodyIndentation: OuterScope + +# namespaces +NamespaceIndentation: All +FixNamespaceComments: true +CompactNamespaces: false + +# Alignment +AlignAfterOpenBracket: BlockIndent +AlignArrayOfStructures: Right +PackConstructorInitializers: Never +AlignTrailingComments: + Kind: Always + OverEmptyLines: 1 +AlignEscapedNewlines: Right +AllowAllArgumentsOnNextLine: true +AllowBreakBeforeNoexceptSpecifier: true +AllowShortBlocksOnASingleLine: true +AllowBreakBeforeNoexceptSpecifier: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: true +AllowShortLambdasOnASingleLine: true +AllowShortLoopsOnASingleLine: true +AlwaysBreakTemplateDeclarations: true +BitFieldColonSpacing: Both + +# includes +SortIncludes: CaseSensitive +IncludeBlocks: Preserve + +# Empty lines +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: Always + +# Prevent indentation on next line after these macros: +StatementMacros: [ESMeta, MetaExternal] + + + +