summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuexi Ma <yuexima@google.com>2017-04-12 18:25:00 -0700
committerYuexi Ma <yuexima@google.com>2017-04-13 05:52:23 +0000
commit0d2994802f6f58fed8fa147ab31de497dc4ec311 (patch)
tree1e58fb5926e37d0d6c0d16d13d33de819612f61e
parent8b8325bc7106c8dba872157bcfb86c7cf518dd17 (diff)
downloadhal-trace-0d2994802f6f58fed8fa147ab31de497dc4ec311.tar.gz
Add pre-upload style checker for cpp and java code
Bug: 37003930 Test: upload CL with wrong format Change-Id: Id5a996892bcd9ff8ae04864d8c097a8a9a6a0286
-rw-r--r--.clang-format13
-rw-r--r--PREUPLOAD.cfg6
2 files changed, 19 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..6027082
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,13 @@
+---
+Language: Cpp
+BasedOnStyle: Google
+ColumnLimit: 80
+IndentWidth: 2
+ContinuationIndentWidth: 4
+---
+Language: Java
+BasedOnStyle: Google
+ColumnLimit: 100
+IndentWidth: 4
+ContinuationIndentWidth: 8
+...
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..6be6e5f
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,6 @@
+[Builtin Hooks]
+clang_format = true
+
+[Builtin Hooks Options]
+clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp,java
+