diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..1fa5a5df45 --- /dev/null +++ b/.clang-format @@ -0,0 +1,43 @@ +# Basic stuff +BasedOnStyle: Microsoft +ColumnLimit: 120 +MaxEmptyLinesToKeep: 2 + +# Preprocessor +IndentPPDirectives: BeforeHash +SortIncludes: false +AlignEscapedNewlines: Left + +# Functions +AllowAllArgumentsOnNextLine: false +BinPackArguments: false +AllowAllParametersOfDeclarationOnNextLine: false +BinPackParameters: false +PenaltyReturnTypeOnItsOwnLine: 1000000000 +AllowShortFunctionsOnASingleLine: Inline + +# Brackets and braces +AlignAfterOpenBracket: BlockIndent +BreakBeforeBraces: Allman + +# Pointers +PointerAlignment: Left + +# Classes +PackConstructorInitializers: NextLineOnly +BreakConstructorInitializers: BeforeComma +AccessModifierOffset: -4 + +# Switch statements +IndentCaseLabels: true +AllowShortCaseLabelsOnASingleLine: true +AlignConsecutiveShortCaseStatements: + Enabled: true + AcrossEmptyLines: false + AcrossComments: true + AlignCaseColons: false + +# Misc +SortUsingDeclarations: false +SpaceAfterTemplateKeyword: false +BreakTemplateDeclarations: Yes