From 4ca7152102a69d9af4b785cc5dbd9f2c2e04f40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= Date: Tue, 23 Jun 2020 15:40:10 +0200 Subject: [PATCH] Enable rustfmt for system/security The rustfmt configuration is linked to the default from build/soong/scripts. This is similar to how clang-format is setup for system/core. Test: Added a commit with a bogus lib.rs and run repo upload. An error is returned by the rusfmt hook. Bug: 157146658 Change-Id: If346bdd73c9cdd84c3cd98ed00b95ed9d790aa4f --- PREUPLOAD.cfg | 2 ++ rustfmt.toml | 1 + 2 files changed, 3 insertions(+) create mode 120000 rustfmt.toml diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index dcf92be1..68df61f1 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -1,8 +1,10 @@ [Builtin Hooks] clang_format = true +rustfmt = true [Builtin Hooks Options] clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp +rustfmt = --check --config-path=rustfmt.toml ${PREUPLOAD_FILES} [Hook Scripts] aosp_hook = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} "." diff --git a/rustfmt.toml b/rustfmt.toml new file mode 120000 index 00000000..ee92d9ef --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +../../build/soong/scripts/rustfmt.toml \ No newline at end of file