diff options
author | Bowgo Tsai <bowgotsai@google.com> | 2017-03-08 16:32:23 +0800 |
---|---|---|
committer | Bowgo Tsai <bowgotsai@google.com> | 2017-03-08 16:51:26 +0800 |
commit | 1aeb8d21076ba50bf423379364158cd71e933bf9 (patch) | |
tree | 0afd7cdb6cddda2f3e92285372532d7d7bec3d21 /PREUPLOAD.cfg | |
parent | 5811a434fc079a50fbf830dc001b0cb46fd4f2d0 (diff) | |
download | core-1aeb8d21076ba50bf423379364158cd71e933bf9.tar.gz core-1aeb8d21076ba50bf423379364158cd71e933bf9.tar.bz2 core-1aeb8d21076ba50bf423379364158cd71e933bf9.zip |
Add a PREUPLOAD.cfg file to run git-clang-format on every commit
The style file .clang-format is copied from adb/.clang-format.
Each sub folders still can have different style by adding their own
.clang-format because git-clang-format uses the style file located
in one of the parent directories of the *source file*.
Also see the following link for previous discussions:
https://android-review.googlesource.com/#/c/340106
Bug: 36046320
Test: repo upload, checks pre-submit fails when the uploading commit
doesn't meet the style
Change-Id: I94369af197da1ccce581bbd861c8737f6a197429
Diffstat (limited to 'PREUPLOAD.cfg')
-rw-r--r-- | PREUPLOAD.cfg | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg new file mode 100644 index 000000000..c8dbf77fa --- /dev/null +++ b/PREUPLOAD.cfg @@ -0,0 +1,5 @@ +[Builtin Hooks] +clang_format = true + +[Builtin Hooks Options] +clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp |