From a9ddd636be6d5cd95c6c6b109619a4b1b109901b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 30 Jan 2016 13:57:08 +0100 Subject: A first clang-format configuration It's not perfect, especially with regards to single-line lambdas where the breaks after the curly-brace is lost, but otherwise it's pretty close already. With clang 3.9 (instead of 3.7) some finer grained controls will be available that might help. Also Q_SLOTS is not yet recognized, but slots works fine. --- .clang-format | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .clang-format (limited to '.clang-format') diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..1822f86 --- /dev/null +++ b/.clang-format @@ -0,0 +1,52 @@ +AccessModifierOffset: -4 +AlignEscapedNewlinesLeft: true +AlignTrailingComments: false +AlignAfterOpenBracket: false +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: false +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: false +BinPackArguments: true +BinPackParameters: true +BreakBeforeBinaryOperators: false +BreakBeforeBraces: Mozilla +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: false +ColumnLimit: 180 +CommentPragmas: '' +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 0 +Cpp11BracedListStyle: false +DerivePointerBinding: false +ForEachMacros: ['foreach', 'Q_FOREACH'] +IndentCaseLabels: true +IndentFunctionDeclarationAfterType: false +IndentWidth: 4 +Language: Cpp +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 100 +PenaltyBreakComment: 100 +PenaltyBreakFirstLessLess: 0 +PenaltyBreakString: 100 +PenaltyExcessCharacter: 1 +PenaltyReturnTypeOnItsOwnLine: 0 +PointerBindsToType: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +Standard: Cpp11 +TabWidth: 4 +UseTab: Never -- cgit v1.2.3