• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[Hook Scripts]
2# Run mypy on all python scripts that exist in the tree. This will only generate
3# errors and warnings related to the CLs being uploaded as long as all other
4# scripts are already linter clean. However, mypy warnings will be repeated when
5# uploading multiple CLs. This is a known limitation which also affects pylint.
6# https://android.googlesource.com/platform/tools/repohooks/#todo_limitations.
7#
8# We cannot use `find ... -execdir mypy {} +` directly since find does not
9# propagate status codes from the -execXXX family of arguments so we use xargs
10# instead. We also cannot use pipes directly in a hook script so we wrap
11# everything inside a shell command (`sh -c`).
12mypy = sh -c "find . -name '*.py' | xargs -I{} mypy {}"
13
14[Builtin Hooks]
15clang_format = true
16commit_msg_bug_field = true
17commit_msg_changeid_field = true
18pylint3 = true
19
20[Builtin Hooks Options]
21clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
22