aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
blob: 72b67488ab0254d220ce72db1a44353de8e14e0d (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
130
131
132
133
134
135
136
137
138
139
140
# SPDX-FileCopyrightText: 2019 Kitsune Ral <Kitsune-Ral@users.sf.net>
# SPDX-FileCopyrightText: 2019 Marc Deop <marc@marcdeop.com>

# SPDX-License-Identifier: LGPL-2.1-or-later

# 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
#AlignConsecutiveMacros: false
#AlignConsecutiveAssignments: false
#AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true # 'Align' since ClangFormat 11 
#AlignTrailingComments: false
#AllowAllArgumentsOnNextLine: true
#AllowAllConstructorInitializersOnNextLine: true
#AllowAllParametersOfDeclarationOnNextLine: true
#AllowShortEnumsOnASingleLine: true
#AllowShortBlocksOnASingleLine: Empty
#AllowShortCaseLabelsOnASingleLine: false
#AllowShortFunctionsOnASingleLine: All
#AllowShortLambdasOnASingleLine: All
#AllowShortIfStatementsOnASingleLine: Never
#AllowShortLoopsOnASingleLine: false
#AlwaysBreakAfterDefinitionReturnType: None # deprecated
#AlwaysBreakAfterReturnType: None
#AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
#BinPackArguments: true
#BinPackParameters: true
BraceWrapping:
  AfterCaseLabel:  false
  AfterClass:      false
  AfterControlStatement: MultiLine
  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
#BreakBeforeTernaryOperators: true
#BreakConstructorInitializersBeforeComma: false # deprecated?
#BreakConstructorInitializers: BeforeComma
#BreakStringLiterals: true
ColumnLimit: 80
#CompactNamespaces: false
#ConstructorInitializerAllOnOneLineOrOnePerLine: false
#ConstructorInitializerIndentWidth: 4
#ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
#DeriveLineEnding: true
#DerivePointerAlignment: false
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
  - Regex:    '^<Qt.+/'
    Priority: 24
  - Regex:    '^<'
    Priority: 32
  - Regex:    '"csapi/'
    Priority: 2
  - Regex:    '"(events|jobs)/'
    Priority: 4
  - Regex:    '.*'
    Priority: 1
IncludeIsMainRegex: '(_test)?$'
#IncludeIsMainSourceRegex: ''
#IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: AfterHash
#IndentWidth: 4
#IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
#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: true
#SpaceAfterCStyleCast: false
#SpaceAfterLogicalNot: false
#SpaceAfterTemplateKeyword: true
#SpaceBeforeAssignmentOperators: true
#SpaceBeforeCpp11BracedList: true
#SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true
#SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
#SpaceInEmptyParentheses: false
#SpacesBeforeTrailingComments: 1
#SpacesInAngles:  false
#SpacesInConditionalStatement: false
#SpacesInContainerLiterals: true
#SpacesInCStyleCastParentheses: false
#SpacesInParentheses: false
#SpacesInSquareBrackets: false
#SpaceBeforeSquareBrackets: false
Standard: c++17
StatementMacros:
  - Q_UNUSED
  - QT_REQUIRE_VERSION
TabWidth: 4
#UseCRLF: false
#UseTab: Never
...