Skip to content

Commit 04382af

Browse files
committed
Slightly better clang-format
Notably clang-format will no longer try to place template header onto the same line as the function declaration. Sadly it will still do it for attributes, because it took until clang-format 16 for it to get the relevant option.
1 parent ac93f19 commit 04382af

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

.clang-format

+21-20
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,42 @@ Standard: c++14
44

55
# Note that we cannot use IncludeIsMainRegex functionality, because it
66
# does not support includes in angle brackets (<>)
7-
SortIncludes: True
7+
SortIncludes: true
88
IncludeBlocks: Regroup
99
IncludeCategories:
10-
- Regex: '<catch2/.*\.hpp>'
10+
- Regex: <catch2/.*\.hpp>
1111
Priority: 1
12-
- Regex: '<.*/.*\.hpp>'
12+
- Regex: <.*/.*\.hpp>
1313
Priority: 2
14-
- Regex: '<.*>'
14+
- Regex: <.*>
1515
Priority: 3
1616

17-
1817
AllowShortBlocksOnASingleLine: Always
1918
AllowShortEnumsOnASingleLine: false
2019
AllowShortFunctionsOnASingleLine: All
2120
AllowShortIfStatementsOnASingleLine: WithoutElse
2221
AllowShortLambdasOnASingleLine: Inline
2322

24-
AccessModifierOffset: '-4'
23+
AccessModifierOffset: "-4"
2524
AlignEscapedNewlines: Left
26-
AllowAllConstructorInitializersOnNextLine: 'true'
27-
BinPackArguments: 'false'
28-
BinPackParameters: 'false'
25+
AllowAllConstructorInitializersOnNextLine: "true"
26+
BinPackArguments: "false"
27+
BinPackParameters: "false"
2928
BreakConstructorInitializers: AfterColon
30-
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
31-
DerivePointerAlignment: 'false'
32-
FixNamespaceComments: 'true'
33-
IndentCaseLabels: 'false'
29+
ConstructorInitializerAllOnOneLineOrOnePerLine: "true"
30+
DerivePointerAlignment: "false"
31+
FixNamespaceComments: "true"
32+
IndentCaseLabels: "false"
3433
IndentPPDirectives: AfterHash
35-
IndentWidth: '4'
34+
IndentWidth: "4"
3635
NamespaceIndentation: All
3736
PointerAlignment: Left
38-
SpaceBeforeCtorInitializerColon: 'false'
39-
SpaceInEmptyParentheses: 'false'
40-
SpacesInParentheses: 'true'
41-
TabWidth: '4'
37+
SpaceBeforeCtorInitializerColon: "false"
38+
SpaceInEmptyParentheses: "false"
39+
SpacesInParentheses: "true"
40+
TabWidth: "4"
4241
UseTab: Never
43-
44-
...
42+
AlwaysBreakTemplateDeclarations: Yes
43+
SpaceAfterTemplateKeyword: true
44+
SortUsingDeclarations: true
45+
ReflowComments: true

0 commit comments

Comments
 (0)