Skip to content

Commit 273111d

Browse files
offahorenmar
authored andcommitted
Clang-format configuration added.
Some notes on the configuration options chosen: * We want `AllowShortEnumsOnASingleLine` set to `false`, but that option is clang-format-11 and up, which is not out yet. * `IndentPPDirectives` is currently inconsistent, but `AfterHash` is the preferred style in new code. * `NamespaceIndentation` is a mess, but `All` is closer to the effect we want than `Inner`. * `SpacesInParentheses` set to `true` is not ideal due to it also introducing extra spaces in preprocessor expressions, but using it is much closer to the current style than not. All in all, using this setting globally would reformat pretty much every line of code in the codebase, but it is as close as possible to the bespoke style currently used. Still, it should only be used on the diffs. Closes catchorg#1182
1 parent a862924 commit 273111d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Diff for: .clang-format

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
AccessModifierOffset: '-4'
3+
AlignEscapedNewlines: Left
4+
AllowAllConstructorInitializersOnNextLine: 'true'
5+
BinPackArguments: 'false'
6+
BinPackParameters: 'false'
7+
BreakConstructorInitializers: AfterColon
8+
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
9+
DerivePointerAlignment: 'false'
10+
FixNamespaceComments: 'true'
11+
IncludeBlocks: Regroup
12+
IndentCaseLabels: 'false'
13+
IndentPPDirectives: AfterHash
14+
IndentWidth: '4'
15+
Language: Cpp
16+
NamespaceIndentation: All
17+
PointerAlignment: Left
18+
SpaceBeforeCtorInitializerColon: 'false'
19+
SpaceInEmptyParentheses: 'false'
20+
SpacesInParentheses: 'true'
21+
Standard: Cpp11
22+
TabWidth: '4'
23+
UseTab: Never
24+
25+
...

0 commit comments

Comments
 (0)