summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-05-11 02:49:33 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-05-11 02:49:33 +0200
commit0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e (patch)
tree29e4ccb73567964564d4180995d3184c0a9a46e2
parentMerge "Device owns the RecoveryUI instance." am: 6df846e337 am: 8d593973d6 (diff)
parentMerge "Document the clang-format usage." am: 797550fb8b (diff)
downloadandroid_bootable_recovery-0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e.tar
android_bootable_recovery-0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e.tar.gz
android_bootable_recovery-0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e.tar.bz2
android_bootable_recovery-0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e.tar.lz
android_bootable_recovery-0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e.tar.xz
android_bootable_recovery-0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e.tar.zst
android_bootable_recovery-0acf8ab2646446c8d5efdb69fbfd32842e1c9c4e.zip
-rw-r--r--.clang-format30
1 files changed, 30 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
index 0e0f4d143..4a3bd2fc3 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,3 +1,33 @@
+# bootable/recovery project uses repohook to apply `clang-format` to the changed lines, with the
+# local style file in `.clang-format`. This will be triggered automatically with `repo upload`.
+# Alternatively, one can stage and format a change with `git clang-format` directly.
+#
+# $ git add <files>
+# $ git clang-format --style file
+#
+# Or to format a committed change.
+#
+# $ git clang-format --style file HEAD~1
+#
+# `--style file` will pick up the local style file in `.clang-format`. This can be configured as the
+# default behavior for bootable/recovery project.
+#
+# $ git config --local clangFormat.style file
+#
+# Note that `repo upload` calls the `clang-format` binary in Android repo (i.e.
+# `$ANDROID_BUILD_TOP/prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format`), which might
+# give slightly different results from the one installed in host machine (e.g.
+# `/usr/bin/clang-format`). Specifying the file with `--binary` will ensure consistent results.
+#
+# $ git clang-format --binary \
+# /path/to/aosp-master/prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format
+#
+# Or to do one-time setup to make it default.
+#
+# $ git config --local clangFormat.binary \
+# /path/to/aosp-master/prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format
+#
+
BasedOnStyle: Google
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty