[v2,2/6] Tweak clang-format

Message ID 20210622103318.478914-3-gprocida@google.com
State New
Headers
Series BTF ABI |

Commit Message

Giuliano Procida June 22, 2021, 10:33 a.m. UTC
  The BTF / SCC code is being migrated out of Google source control into
AOSP. This comes with the opportunity to migrate the style to be
closer libabigail's.

In the first instance it makes sense to just reformat it with
clang-format. I've updated this as follows.

AlignConsecutiveDeclarations: false - as this is closer on average to
libgabigail code and looks nicer for the new code anyway

AllowShort*: (true) - these in theory should make things closer to
libabigail style but in practice don't appear make any difference

Cpp11BracedListStyle: true - this seems to improve some initialiser
syntax

BinPackArguments: false - we already turn this off for parameters

SpaceAfterCStyleCast: true - seems to be the libabigail style

	* .clang-format: Various tweaks for new BTF code.

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

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