xref: /libCEED/examples/deal.II/.clang-format (revision 5aed82e4fa97acf4ba24a7f10a35f5303a6798e0)
1#
2# The clang-format (Clang 11) style file used by deal.II.
3#
4
5AccessModifierOffset: -2
6
7AlignAfterOpenBracket: Align
8AlignConsecutiveAssignments: true
9AlignConsecutiveDeclarations: true
10AlignEscapedNewlines: Left
11AlignOperands: true
12AlignTrailingComments: true
13
14AllowAllParametersOfDeclarationOnNextLine: false
15AllowShortBlocksOnASingleLine: false
16AllowShortCaseLabelsOnASingleLine: false
17AllowShortFunctionsOnASingleLine: None
18AllowShortIfStatementsOnASingleLine: false
19AllowShortLoopsOnASingleLine: false
20
21AlwaysBreakAfterReturnType: All
22AlwaysBreakBeforeMultilineStrings: false
23AlwaysBreakTemplateDeclarations: true
24
25BinPackArguments: false
26BinPackParameters: false
27
28BraceWrapping:
29  AfterCaseLabel: true
30  AfterClass: true
31  AfterControlStatement: Always
32  AfterEnum: true
33  AfterExternBlock: true
34  AfterFunction: true
35  AfterNamespace: true
36  AfterStruct: true
37  AfterUnion: true
38  BeforeCatch: true
39  BeforeElse: true
40  BeforeLambdaBody: false
41  BeforeWhile: true
42  IndentBraces: true
43  SplitEmptyFunction: false
44  SplitEmptyRecord: false
45  SplitEmptyNamespace: false
46
47BreakBeforeBinaryOperators: None
48BreakBeforeBraces: Custom
49BreakBeforeInheritanceComma: false
50BreakBeforeTernaryOperators: false
51BreakConstructorInitializers: BeforeComma
52BreakStringLiterals: false
53
54ColumnLimit: 100
55
56CompactNamespaces: false
57
58ConstructorInitializerIndentWidth: 2
59
60ContinuationIndentWidth: 2
61
62Cpp11BracedListStyle: true
63
64DerivePointerAlignment: false
65
66FixNamespaceComments: true
67
68IncludeBlocks: Regroup
69IncludeCategories:
70# config.h must always be first:
71  - Regex:    "deal.II/base/config.h"
72    Priority: -1
73# deal.II folders in sorted order:
74  - Regex:    "deal.II/algorithms/.*\\.h"
75    Priority: 100
76  - Regex:    "deal.II/arborx/.*\\.h"
77    Priority: 110
78  - Regex:    "deal.II/base/.*\\.h"
79    Priority: 120
80  - Regex:    "deal.II/boost_adaptors/.*\\.h"
81    Priority: 125
82  - Regex:    "deal.II/differentiation/.*\\.h"
83    Priority: 130
84  - Regex:    "deal.II/distributed/.*\\.h"
85    Priority: 140
86  - Regex:    "deal.II/dofs/.*\\.h"
87    Priority: 150
88  - Regex:    "deal.II/fe/.*\\.h"
89    Priority: 160
90  - Regex:    "deal.II/gmsh/.*\\.h"
91    Priority: 170
92  - Regex:    "deal.II/grid/.*\\.h"
93    Priority: 180
94  - Regex:    "deal.II/hp/.*\\.h"
95    Priority: 190
96  - Regex:    "deal.II/integrators/.*\\.h"
97    Priority: 200
98  - Regex:    "deal.II/lac/.*\\.h"
99    Priority: 210
100  - Regex:    "deal.II/matrix_free/.*\\.h"
101    Priority: 220
102  - Regex:    "deal.II/meshworker/.*\\.h"
103    Priority: 230
104  - Regex:    "deal.II/multigrid/.*\\.h"
105    Priority: 240
106  - Regex:    "deal.II/non_matching/.*\\.h"
107    Priority: 250
108  - Regex:    "deal.II/numerics/.*\\.h"
109    Priority: 260
110  - Regex:    "deal.II/opencascade/.*\\.h"
111    Priority: 270
112  - Regex:    "deal.II/optimization/.*\\.h"
113    Priority: 280
114  - Regex:    "deal.II/particles/.*\\.h"
115    Priority: 290
116  - Regex:    "deal.II/physics/.*\\.h"
117    Priority: 300
118  - Regex:    "deal.II/sundials/.*\\.h"
119    Priority: 310
120# put boost right after deal:
121  - Regex: "<boost.*>"
122    Priority: 500
123# try to group PETSc headers:
124  - Regex: "<petsc.*\\.h>"
125    Priority: 1000
126# try to catch all third party headers and put them after deal.II but before
127# standard headers:
128  - Regex: "<.*\\.(h|hpp|hxx)>"
129    Priority: 2000
130# match all standard headers. Things like '#include <armadillo>' should be
131# surrounded by #ifdef checks (which will not be merged by clang-format) so they
132# should not be caught here
133  - Regex: "<[a-z_]+>"
134    Priority: 100000
135# make sure that "../tests.h" appears before all other local include files
136# such that replacing Assert in tests also applies to the testing header files.
137  - Regex: "\\.\\./tests\\.h"
138    Priority: 200000
139
140IndentCaseLabels: true
141IndentPPDirectives: AfterHash
142IndentWidth: 2
143
144IndentWrappedFunctionNames: false
145
146KeepEmptyLinesAtTheStartOfBlocks: false
147
148Language: Cpp
149
150MaxEmptyLinesToKeep: 3
151
152NamespaceIndentation: All
153
154PenaltyBreakBeforeFirstCallParameter: 90
155
156PointerAlignment: Right
157
158ReflowComments: true
159CommentPragmas: '( \| |\*--|<li>|@ref | @p |@param |@name |@returns |@warning |@ingroup |@author |@date |@related |@relates |@relatesalso |@deprecated |@image |@return |@brief |@attention |@copydoc |@addtogroup |@todo |@tparam |@see |@note |@skip |@skipline |@until |@line |@dontinclude |@include | TESTARGS)'
160
161SortIncludes: true
162SortUsingDeclarations: true
163
164SpaceAfterCStyleCast: false
165SpaceAfterTemplateKeyword: true
166SpaceBeforeAssignmentOperators: true
167SpaceBeforeParens: ControlStatements
168SpaceInEmptyParentheses: false
169SpacesBeforeTrailingComments: 1
170SpacesInAngles: false
171SpacesInCStyleCastParentheses: false
172SpacesInContainerLiterals: false
173SpacesInParentheses: false
174SpacesInSquareBrackets: false
175
176Standard: Cpp11
177
178TabWidth: 2
179
180UseTab: Never
181