• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
31BasedOnStyle: Google
32AllowShortBlocksOnASingleLine: false
33AllowShortFunctionsOnASingleLine: Empty
34AllowShortIfStatementsOnASingleLine: true
35
36ColumnLimit: 100
37CommentPragmas: NOLINT:.*
38DerivePointerAlignment: false
39IncludeBlocks: Preserve
40IndentWidth: 2
41PointerAlignment: Left
42TabWidth: 2
43UseTab: Never
44
45Cpp11BracedListStyle: false
46