Tweak clang-format configuration

Message ID 20211011131709.1004124-1-gprocida@google.com
State New
Headers
Series Tweak clang-format configuration |

Commit Message

Giuliano Procida Oct. 11, 2021, 1:17 p.m. UTC
  These are the updates:

AlignConsecutiveDeclarations: false
- the dominant style in libabigail is not to align

AllowShortBlocksOnASingleLine: Always
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
- the libabigail style favours short things on a single line

Cpp11BracedListStyle: true
- this seems to improve some initialiser syntax

BinPackArguments: false
- we already turn this off for parameters

SpaceAfterCStyleCast: true
- this is the libabigail style

	* .clang-format: Various tweaks to Clang format configuration.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 .clang-format | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
  

Comments

Dodji Seketeli Oct. 19, 2021, 11:16 a.m. UTC | #1
Hello Giuliano,

Giuliano Procida <gprocida@google.com> a écrit:

[...]

> 	* .clang-format: Various tweaks to Clang format configuration.
>
> Signed-off-by: Giuliano Procida <gprocida@google.com>

Applied to master.

Thanks!

Cheers,
  

Patch

diff --git a/.clang-format b/.clang-format
index 1b422dfb..d09d739a 100644
--- a/.clang-format
+++ b/.clang-format
@@ -2,17 +2,24 @@ 
 ---
 BasedOnStyle: GNU
 Standard: c++11
-AlignConsecutiveDeclarations: true
+AlignConsecutiveDeclarations: false
+AllowShortBlocksOnASingleLine: Always
+AllowShortEnumsOnASingleLine: true
+AllowShortFunctionsOnASingleLine: All
+AllowShortLambdasOnASingleLine: All
 AlwaysBreakAfterReturnType: All
 BreakConstructorInitializers: BeforeColon
 ConstructorInitializerAllOnOneLineOrOnePerLine: true
 ConstructorInitializerIndentWidth: 2
+Cpp11BracedListStyle: true
 IndentWidth: 2
 AlignAfterOpenBracket: Align
+BinPackArguments: false
 BinPackParameters: false
 BreakStringLiterals: false
 PointerAlignment: Left
 SortUsingDeclarations: false
+SpaceAfterCStyleCast: true
 SpaceBeforeParens: ControlStatements
 TabWidth: 8
 UseTab: Always