aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-05-19 15:33:15 +0900
committerGitHub <noreply@github.com>2019-05-19 15:33:15 +0900
commit9087c2fbe8369fd18a47b4edc5ecf20c438ff0ce (patch)
tree7ee9af48db306c6216e131e2f5a687f39a360143 /.clang-format
parentaacc4bcb4a487871daae6717f77605aaba444341 (diff)
downloadlibquotient-9087c2fbe8369fd18a47b4edc5ecf20c438ff0ce.tar.gz
libquotient-9087c2fbe8369fd18a47b4edc5ecf20c438ff0ce.zip
Update .clang-format as per the field experience
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format214
1 files changed, 112 insertions, 102 deletions
diff --git a/.clang-format b/.clang-format
index 12054877..ffbf6597 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,119 +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: 0
+Language: Cpp
+BasedOnStyle: WebKit
+#AccessModifierOffset: -4
AlignAfterOpenBracket: Align
-AlignConsecutiveAssignments: false
-AlignConsecutiveDeclarations: false
-AlignEscapedNewlines: Right
-AlignOperands: false
-AlignTrailingComments: false
-AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: All
-AllowShortIfStatementsOnASingleLine: false
-AllowShortLoopsOnASingleLine: false
-AlwaysBreakAfterDefinitionReturnType: None
-AlwaysBreakAfterReturnType: None
-AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: MultiLine
-BinPackArguments: true
-BinPackParameters: true
-BraceWrapping:
- AfterClass: true
- AfterControlStatement: false
- AfterEnum: false
- AfterFunction: true
- AfterNamespace: false
- AfterObjCDeclaration: false
- AfterStruct: false
- AfterUnion: false
- BeforeCatch: false
- BeforeElse: false
- IndentBraces: false
+#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: Yes
+#BinPackArguments: true
+#BinPackParameters: true
+BraceWrapping:
+ AfterClass: true
+ AfterControlStatement: false
+ AfterEnum: true
+ AfterFunction: true
+ AfterNamespace: true
+ AfterStruct: true
+ AfterUnion: true
+ AfterExternBlock: true
+ BeforeCatch: false
+ BeforeElse: false
+ IndentBraces: false
+ SplitEmptyFunction: false
+ SplitEmptyRecord: false
+ SplitEmptyNamespace: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
-BreakBeforeInheritanceComma: false
+#BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
-BreakBeforeTernaryOperators: true
-BreakConstructorInitializersBeforeComma: false
-BreakAfterJavaFieldAnnotations: false
-BreakStringLiterals: true
-ColumnLimit: 80
-CommentPragmas: "^ IWYU pragma:|^!|^:"
+#BreakBeforeTernaryOperators: true
+#BreakConstructorInitializersBeforeComma: false
+#BreakConstructorInitializers: BeforeComma
+#BreakStringLiterals: true
+ColumnLimit: 80
+CommentPragmas: '^!|^:'
CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: true
-ConstructorInitializerIndentWidth: 4
-ContinuationIndentWidth: 8
+#ConstructorInitializerAllOnOneLineOrOnePerLine: false
+#ConstructorInitializerIndentWidth: 4
+#ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
-DerivePointerAlignment: false
-DisableFormat: false
-ExperimentalAutoDetectBinPacking: false
-FixNamespaceComments: false
-ForEachMacros:
+#DerivePointerAlignment: false
+FixNamespaceComments: true
+ForEachMacros:
- foreach
- Q_FOREACH
- - BOOST_FOREACH
-IncludeBlocks: Preserve
-IncludeCategories:
- - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
- Priority: 2
- - Regex: '^(<|"(gtest|gmock|isl|json)/)'
- Priority: 3
- - Regex: '.*'
- Priority: 1
-IncludeIsMainRegex: '(Test)?$'
-IndentCaseLabels: false
-IndentPPDirectives: None
-IndentWidth: 4
-IndentWrappedFunctionNames: false
-JavaScriptQuotes: Leave
-JavaScriptWrapImports: true
-KeepEmptyLinesAtTheStartOfBlocks: true
-MacroBlockBegin: ''
-MacroBlockEnd: ''
-MaxEmptyLinesToKeep: 1
-NamespaceIndentation: All
-ObjCBinPackProtocolList: Auto
-ObjCBlockIndentWidth: 4
-ObjCSpaceAfterProperty: true
-ObjCSpaceBeforeProtocolList: true
-PenaltyBreakAssignment: 2
-PenaltyBreakBeforeFirstCallParameter: 19
-PenaltyBreakComment: 300
-PenaltyBreakFirstLessLess: 120
-PenaltyBreakString: 1000
-PenaltyBreakTemplateDeclaration: 10
-PenaltyExcessCharacter: 1000000
+ - 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: 50
+PenaltyBreakBeforeFirstCallParameter: 70
+#PenaltyBreakComment: 300
+#PenaltyBreakFirstLessLess: 120
+#PenaltyBreakString: 1000
+#PenaltyBreakTemplateDeclaration: 10
+PenaltyExcessCharacter: 20
PenaltyReturnTypeOnItsOwnLine: 60
-PointerAlignment: Left
-PointerBindsToType: false
-ReflowComments: true
-SortIncludes: true
-SortUsingDeclarations: true
-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: 8
-UseTab: Never
+#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
...