Skip to content

Commit

Permalink
Add a 2 width option of clang format.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cferris1000 committed Mar 10, 2017
1 parent ce7ee08 commit a78d9a2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
13 changes: 0 additions & 13 deletions .clang-format

This file was deleted.

1 change: 1 addition & 0 deletions .clang-format
13 changes: 13 additions & 0 deletions .clang-format-2
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions .clang-format-4
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions libbacktrace/.clang-format

0 comments on commit a78d9a2

Please sign in to comment.