Skip to content

Commit a78d9a2

Browse files
committed
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
1 parent ce7ee08 commit a78d9a2

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

.clang-format

-13
This file was deleted.

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.clang-format-4

.clang-format-2

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BasedOnStyle: Google
2+
AllowShortBlocksOnASingleLine: false
3+
AllowShortFunctionsOnASingleLine: true
4+
5+
AccessModifierOffset: -1
6+
ColumnLimit: 100
7+
CommentPragmas: NOLINT:.*
8+
DerivePointerAlignment: false
9+
IndentWidth: 2
10+
PointerAlignment: Left
11+
TabWidth: 2
12+
UseTab: Never
13+
PenaltyExcessCharacter: 32

.clang-format-4

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BasedOnStyle: Google
2+
AllowShortBlocksOnASingleLine: false
3+
AllowShortFunctionsOnASingleLine: false
4+
5+
AccessModifierOffset: -2
6+
ColumnLimit: 100
7+
CommentPragmas: NOLINT:.*
8+
DerivePointerAlignment: false
9+
IndentWidth: 4
10+
PointerAlignment: Left
11+
TabWidth: 4
12+
UseTab: Never
13+
PenaltyExcessCharacter: 32

libbacktrace/.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.clang-format-2

0 commit comments

Comments
 (0)