diff options
Diffstat (limited to '.clang-format')
-rw-r--r-- | .clang-format | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..40262bc3 --- /dev/null +++ b/.clang-format @@ -0,0 +1,129 @@ +# Copyright (C) 2019 Project Quotient +# +# You may use this file under the terms of the LGPL-2.1 license +# See the file LICENSE from this package for details. + +# This is the clang-format configuration style to be used by libQuotient. +# Inspired by: +# https://code.qt.io/cgit/qt/qt5.git/plain/_clang-format +# https://wiki.qt.io/Qt_Coding_Style +# https://wiki.qt.io/Coding_Conventions +# Further information: https://clang.llvm.org/docs/ClangFormatStyleOptions.html + +# For convenience, the file includes commented out settings that we assume +# to borrow from the WebKit style. The values for such settings try to but +# are not guaranteed to coincide with the latest version of the WebKit style. + +--- +Language: Cpp +BasedOnStyle: WebKit +#AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +#AlignConsecutiveAssignments: false +#AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: true +#AlignTrailingComments: false +#AllowAllParametersOfDeclarationOnNextLine: true +#AllowShortBlocksOnASingleLine: false +#AllowShortCaseLabelsOnASingleLine: false +#AllowShortFunctionsOnASingleLine: All +#AllowShortIfStatementsOnASingleLine: false +#AllowShortLoopsOnASingleLine: false +#AlwaysBreakAfterReturnType: None +#AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +#BinPackArguments: true +#BinPackParameters: true +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Custom +#BreakBeforeInheritanceComma: false +#BreakInheritanceList: BeforeColon # Only supported since clang-format 7 +#BreakBeforeTernaryOperators: true +#BreakConstructorInitializersBeforeComma: false +#BreakConstructorInitializers: BeforeComma +#BreakStringLiterals: true +ColumnLimit: 80 +#CommentPragmas: '^!|^:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +#ConstructorInitializerIndentWidth: 4 +#ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +#DerivePointerAlignment: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - forever +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^<Qt.+/' + Priority: 24 + - Regex: '^<' + Priority: 32 + - Regex: '"csapi/' + Priority: 2 + - Regex: '"(events|jobs)/' + Priority: 4 + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(_test)?$' +#IndentCaseLabels: false +IndentPPDirectives: AfterHash +#IndentWidth: 4 +#IndentWrappedFunctionNames: false +#JavaScriptQuotes: Leave +#JavaScriptWrapImports: true +#KeepLineBreaksForNonEmptyLines: false +#KeepEmptyLinesAtTheStartOfBlocks: true +#MacroBlockBegin: '' +#MacroBlockEnd: '' +#MaxEmptyLinesToKeep: 1 +#NamespaceIndentation: Inner +PenaltyBreakAssignment: 30 +PenaltyBreakBeforeFirstCallParameter: 50 +PenaltyBreakComment: 45 +#PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 200 +#PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 20 +PenaltyReturnTypeOnItsOwnLine: 60 +#PointerAlignment: Left +#ReflowComments: true +#SortIncludes: true +SortUsingDeclarations: false +#SpaceAfterCStyleCast: false +#SpaceAfterTemplateKeyword: true +#SpaceBeforeAssignmentOperators: true +#SpaceBeforeCpp11BracedList: true +#SpaceBeforeCtorInitializerColon: true +#SpaceBeforeInheritanceColon: true +#SpaceBeforeParens: ControlStatements +#SpaceBeforeRangeBasedForLoopColon: true +#SpaceInEmptyParentheses: false +#SpacesBeforeTrailingComments: 1 +#SpacesInAngles: false +#SpacesInContainerLiterals: true +#SpacesInCStyleCastParentheses: false +#SpacesInParentheses: false +#SpacesInSquareBrackets: false +Standard: Cpp11 +#TabWidth: 4 +#UseTab: Never +... |