Tao Bao | 601493e | 2018-05-10 12:07:47 -0700 | [diff] [blame] | 1 | # bootable/recovery project uses repohook to apply `clang-format` to the changed lines, with the |
| 2 | # local style file in `.clang-format`. This will be triggered automatically with `repo upload`. |
| 3 | # Alternatively, one can stage and format a change with `git clang-format` directly. |
| 4 | # |
| 5 | # $ git add <files> |
| 6 | # $ git clang-format --style file |
| 7 | # |
| 8 | # Or to format a committed change. |
| 9 | # |
| 10 | # $ git clang-format --style file HEAD~1 |
| 11 | # |
| 12 | # `--style file` will pick up the local style file in `.clang-format`. This can be configured as the |
| 13 | # default behavior for bootable/recovery project. |
| 14 | # |
| 15 | # $ git config --local clangFormat.style file |
| 16 | # |
| 17 | # Note that `repo upload` calls the `clang-format` binary in Android repo (i.e. |
| 18 | # `$ANDROID_BUILD_TOP/prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format`), which might |
| 19 | # give slightly different results from the one installed in host machine (e.g. |
| 20 | # `/usr/bin/clang-format`). Specifying the file with `--binary` will ensure consistent results. |
| 21 | # |
| 22 | # $ git clang-format --binary \ |
| 23 | # /path/to/aosp-master/prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format |
| 24 | # |
| 25 | # Or to do one-time setup to make it default. |
| 26 | # |
| 27 | # $ git config --local clangFormat.binary \ |
| 28 | # /path/to/aosp-master/prebuilts/clang/host/linux-x86/clang-stable/bin/clang-format |
| 29 | # |
| 30 | |
Tao Bao | 74bda5f | 2016-11-03 15:17:32 -0700 | [diff] [blame] | 31 | BasedOnStyle: Google |
| 32 | AllowShortBlocksOnASingleLine: false |
Tao Bao | e65fa0a | 2016-12-12 14:49:21 -0800 | [diff] [blame] | 33 | AllowShortFunctionsOnASingleLine: Empty |
| 34 | AllowShortIfStatementsOnASingleLine: true |
Tao Bao | 74bda5f | 2016-11-03 15:17:32 -0700 | [diff] [blame] | 35 | |
| 36 | ColumnLimit: 100 |
| 37 | CommentPragmas: NOLINT:.* |
| 38 | DerivePointerAlignment: false |
Yifan Hong | dff8004 | 2020-04-28 13:31:11 -0700 | [diff] [blame] | 39 | IncludeBlocks: Preserve |
Tao Bao | 74bda5f | 2016-11-03 15:17:32 -0700 | [diff] [blame] | 40 | IndentWidth: 2 |
| 41 | PointerAlignment: Left |
| 42 | TabWidth: 2 |
| 43 | UseTab: Never |
Tao Bao | 74bda5f | 2016-11-03 15:17:32 -0700 | [diff] [blame] | 44 | |
| 45 | Cpp11BracedListStyle: false |