aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
blob: 1869dfe6cedcacd0dd72fdd9fc876e242461a71f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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: 10
PenaltyBreakBeforeFirstCallParameter: 70
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: false
#SpaceInEmptyParentheses: false
#SpacesBeforeTrailingComments: 1
#SpacesInAngles:  false
#SpacesInContainerLiterals: true
#SpacesInCStyleCastParentheses: false
#SpacesInParentheses: false
#SpacesInSquareBrackets: false
Standard: Cpp11
#TabWidth: 4
#UseTab: Never
...