From 0dd3ab5387083abf8ddab5af863c9845dc049169 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 10 Jul 2019 15:04:04 -0700 Subject: [PATCH] system-clang-format: Add Standard: Cpp11 clang-format tries to automatically detect the Cpp standard used, particularly when determining to put spaces in template definitions: Cpp03: std::vector > vs Cpp11: std::vector> It doesn't always get this correct as seen in https://android-review.googlesource.com/c/platform/system/core/+/973463/8 but since we know that all code within Android is C++17, we can safely assume it should be formatted with the newer standard. Test: clang-format doesn't break the above change. Change-Id: I7d1d709690b7bca6da3863cc9a58e53eaec751b0 --- scripts/system-clang-format | 1 + scripts/system-clang-format-2 | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/system-clang-format b/scripts/system-clang-format index 14abd934b..a7614d29f 100644 --- a/scripts/system-clang-format +++ b/scripts/system-clang-format @@ -1,4 +1,5 @@ BasedOnStyle: Google +Standard: Cpp11 AccessModifierOffset: -2 AllowShortFunctionsOnASingleLine: Inline ColumnLimit: 100 diff --git a/scripts/system-clang-format-2 b/scripts/system-clang-format-2 index e28b379c4..a4e23f860 100644 --- a/scripts/system-clang-format-2 +++ b/scripts/system-clang-format-2 @@ -1,4 +1,5 @@ BasedOnStyle: Google +Standard: Cpp11 AllowShortFunctionsOnASingleLine: Inline ColumnLimit: 100 CommentPragmas: NOLINT:.*