From a78d9a293cf3bdca23c5cd6ef92966f40e851009 Mon Sep 17 00:00:00 2001
From: Christopher Ferris <cferris@google.com>
Date: Fri, 10 Mar 2017 11:25:32 -0800
Subject: [PATCH] Add a 2 width option of clang format.

Make the default the 4 tab space version.

Add a link to the 2 space version for libbacktrace.

The only other difference between the 4 space and 2 space tab version
is that the 2 space tab version allows short functions on a single line.
This is for things like constructors, short destructors, or accessor
functions. I believe this is closer to the Google C++ style guide.

Bug: 36046320

Test: NA
Change-Id: Ida08db18902eeb101f42869dd5590182529d54ef
---
 .clang-format              | 14 +-------------
 .clang-format-2            | 13 +++++++++++++
 .clang-format-4            | 13 +++++++++++++
 libbacktrace/.clang-format |  1 +
 4 files changed, 28 insertions(+), 13 deletions(-)
 mode change 100644 => 120000 .clang-format
 create mode 100644 .clang-format-2
 create mode 100644 .clang-format-4
 create mode 120000 libbacktrace/.clang-format

diff --git a/.clang-format b/.clang-format
deleted file mode 100644
index fc4eb1bc03..0000000000
--- a/.clang-format
+++ /dev/null
@@ -1,13 +0,0 @@
-BasedOnStyle: Google
-AllowShortBlocksOnASingleLine: false
-AllowShortFunctionsOnASingleLine: false
-
-AccessModifierOffset: -2
-ColumnLimit: 100
-CommentPragmas: NOLINT:.*
-DerivePointerAlignment: false
-IndentWidth: 4
-PointerAlignment: Left
-TabWidth: 4
-UseTab: Never
-PenaltyExcessCharacter: 32
diff --git a/.clang-format b/.clang-format
new file mode 120000
index 0000000000..9b45e0ae8d
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1 @@
+.clang-format-4
\ No newline at end of file
diff --git a/.clang-format-2 b/.clang-format-2
new file mode 100644
index 0000000000..fb967d888e
--- /dev/null
+++ b/.clang-format-2
@@ -0,0 +1,13 @@
+BasedOnStyle: Google
+AllowShortBlocksOnASingleLine: false
+AllowShortFunctionsOnASingleLine: true
+
+AccessModifierOffset: -1
+ColumnLimit: 100
+CommentPragmas: NOLINT:.*
+DerivePointerAlignment: false
+IndentWidth: 2
+PointerAlignment: Left
+TabWidth: 2
+UseTab: Never
+PenaltyExcessCharacter: 32
diff --git a/.clang-format-4 b/.clang-format-4
new file mode 100644
index 0000000000..fc4eb1bc03
--- /dev/null
+++ b/.clang-format-4
@@ -0,0 +1,13 @@
+BasedOnStyle: Google
+AllowShortBlocksOnASingleLine: false
+AllowShortFunctionsOnASingleLine: false
+
+AccessModifierOffset: -2
+ColumnLimit: 100
+CommentPragmas: NOLINT:.*
+DerivePointerAlignment: false
+IndentWidth: 4
+PointerAlignment: Left
+TabWidth: 4
+UseTab: Never
+PenaltyExcessCharacter: 32
diff --git a/libbacktrace/.clang-format b/libbacktrace/.clang-format
new file mode 120000
index 0000000000..fd0645fdf9
--- /dev/null
+++ b/libbacktrace/.clang-format
@@ -0,0 +1 @@
+../.clang-format-2
\ No newline at end of file
-- 
GitLab