diff --git a/.clang-format b/.clang-format index 8a799fd7ecec42306b9b760019b5dee298f17694..04b712148600bd00e36b7347ff6ae9b42d7c1121 100644 --- a/.clang-format +++ b/.clang-format @@ -1,8 +1,16 @@ +# Based on the .clang-format for Qt Creator +# +# This is for clang-format >= 10.0. +# +# https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html +# +--- Language: Cpp AccessModifierOffset: -4 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false +AlignConsecutiveMacros: true AlignEscapedNewlines: DontAlign AlignOperands: true AlignTrailingComments: true @@ -11,11 +19,11 @@ AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: Inline AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterReturnType: None +AlwaysBreakAfterReturnType: TopLevelDefinitions AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: true -AlwaysBreakAfterDefinitionReturnType: All +AlwaysBreakTemplateDeclarations: Yes BinPackArguments: false BinPackParameters: false BraceWrapping: @@ -67,7 +75,6 @@ IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false -# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between. MacroBlockBegin: "" MacroBlockEnd: "" MaxEmptyLinesToKeep: 1 @@ -82,13 +89,14 @@ PenaltyBreakFirstLessLess: 400 PenaltyBreakString: 600 PenaltyExcessCharacter: 50 PenaltyReturnTypeOnItsOwnLine: 300 -PointerAlignment: Right -ReflowComments: false -SortIncludes: true -SortUsingDeclarations: true +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: false SpaceAfterCStyleCast: true SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 @@ -98,4 +106,5 @@ SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp11 -TabWidth: 4 \ No newline at end of file +TabWidth: 4 +UseTab: Never