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 {}"
13test_manifest_compiler = ./tools/test_manifest_compiler.py
14
15[Builtin Hooks]
16clang_format = true
17commit_msg_bug_field = true
18commit_msg_changeid_field = true
19rustfmt = true
20pylint3 = true
21
22[Builtin Hooks Options]
23clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
24rustfmt = --config-path=rustfmt.toml
25