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