diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..a9f58c3d --- /dev/null +++ b/.clang-format @@ -0,0 +1,72 @@ +--- +BasedOnStyle: WebKit +Language: Cpp +Standard: Cpp14 + +IndentWidth: 4 +SpacesBeforeTrailingComments: 1 +TabWidth: 8 +UseTab: Never +ContinuationIndentWidth: 4 +MaxEmptyLinesToKeep: 3 +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakConstructorInitializersBeforeComma: true + +BreakBeforeBraces: Custom +BraceWrapping: + AfterClass: true + AfterControlStatement: false + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + +ForEachMacros: + - forever # avoids { wrapped to next line + - foreach + - Q_FOREACH + +AccessModifierOffset: -4 +ConstructorInitializerIndentWidth: 4 +AlignEscapedNewlinesLeft: false +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortEnumsOnASingleLine: false # requires clang-format 11 +AlignAfterOpenBracket: true +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackParameters: true +ColumnLimit: 100 +Cpp11BracedListStyle: false +DerivePointerBinding: false +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: false +NamespaceIndentation: None +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 60 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerBindsToType: false +SpaceAfterTemplateKeyword: false +IndentFunctionDeclarationAfterType: false +SpaceAfterControlStatementKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceInEmptyParentheses: false +SpacesInAngles: false +SpacesInCStyleCastParentheses: true +SpacesInParentheses: false +... +