Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-11-07 21:47:38 +0100
committerMartin Hořeňovský2022-11-07 23:14:29 +0100
commitfdea5a52c22007ae7bed356409a6c693a538b333 (patch)
treee92fb22b5ef4ad3750bd66793ffe20dc16a7b29b
parent297a17593fe6c0545fe28cfb909243ee831ac27f (diff)
downloadcatch3-fdea5a52c22007ae7bed356409a6c693a538b333.tar.gz
Improve the .clang-format file a bit
* add include sorting and grouping * allow some short blocks to be on a single line
-rw-r--r--.clang-format25
1 files changed, 22 insertions, 3 deletions
diff --git a/.clang-format b/.clang-format
index 2a82aacf..f67a5862 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,4 +1,26 @@
---
+Language: Cpp
+Standard: c++14
+
+# Note that we cannot use IncludeIsMainRegex functionality, because it
+# does not support includes in angle brackets (<>)
+SortIncludes: True
+IncludeBlocks: Regroup
+IncludeCategories:
+ - Regex: '<catch2/.*\.hpp>'
+ Priority: 1
+ - Regex: '<.*/.*\.hpp>'
+ Priority: 2
+ - Regex: '<.*>'
+ Priority: 3
+
+
+AllowShortBlocksOnASingleLine: Always
+AllowShortEnumsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: WithoutElse
+AllowShortLambdasOnASingleLine: Inline
+
AccessModifierOffset: '-4'
AlignEscapedNewlines: Left
AllowAllConstructorInitializersOnNextLine: 'true'
@@ -8,17 +30,14 @@ BreakConstructorInitializers: AfterColon
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
DerivePointerAlignment: 'false'
FixNamespaceComments: 'true'
-IncludeBlocks: Regroup
IndentCaseLabels: 'false'
IndentPPDirectives: AfterHash
IndentWidth: '4'
-Language: Cpp
NamespaceIndentation: All
PointerAlignment: Left
SpaceBeforeCtorInitializerColon: 'false'
SpaceInEmptyParentheses: 'false'
SpacesInParentheses: 'true'
-Standard: Cpp11
TabWidth: '4'
UseTab: Never