blob: 6fa717cfb941d7351d9a8c794f975fc8aeef3cdb [file] [log] [blame]
Tao Bao601493e2018-05-10 12:07:47 -07001# 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 Bao74bda5f2016-11-03 15:17:32 -070031BasedOnStyle: Google
32AllowShortBlocksOnASingleLine: false
Tao Baoe65fa0a2016-12-12 14:49:21 -080033AllowShortFunctionsOnASingleLine: Empty
34AllowShortIfStatementsOnASingleLine: true
Tao Bao74bda5f2016-11-03 15:17:32 -070035
36ColumnLimit: 100
37CommentPragmas: NOLINT:.*
38DerivePointerAlignment: false
Yifan Hongdff80042020-04-28 13:31:11 -070039IncludeBlocks: Preserve
Tao Bao74bda5f2016-11-03 15:17:32 -070040IndentWidth: 2
41PointerAlignment: Left
42TabWidth: 2
43UseTab: Never
Tao Bao74bda5f2016-11-03 15:17:32 -070044
45Cpp11BracedListStyle: false