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
This commit is contained in:
Christopher Ferris 2017-03-10 11:25:32 -08:00
parent ce7ee088ff
commit a78d9a293c
4 changed files with 28 additions and 13 deletions

View file

@ -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

1
.clang-format Symbolic link
View file

@ -0,0 +1 @@
.clang-format-4

13
.clang-format-2 Normal file
View file

@ -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

13
.clang-format-4 Normal file
View file

@ -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

1
libbacktrace/.clang-format Symbolic link
View file

@ -0,0 +1 @@
../.clang-format-2