From c13f6bfa45790548c43314db6e51ecc2b5999219 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Tue, 11 Jul 2023 21:13:43 +0000 Subject: aidl_format: Fix `aidl_api` directory exception for aidl_format hook It wasn't matching files correctly when the `aidl_api` directory was at the base of the git repository. In those cases the file name shows up as `aidl_api/path/to/files` and doesn't have the path separator in front of `aidl_api/`. Test: upload aosp/2653183 Bug: None Change-Id: Id87a0111f76a46c8cc84a3af57d3cb1deeb54814 --- rh/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rh/hooks.py b/rh/hooks.py index 457a440..162dd6b 100644 --- a/rh/hooks.py +++ b/rh/hooks.py @@ -1012,7 +1012,7 @@ def check_android_test_mapping(project, commit, _desc, diff, options=None): def check_aidl_format(project, commit, _desc, diff, options=None): """Checks that AIDL files are formatted with aidl-format.""" # All *.aidl files except for those under aidl_api directory. - filtered = _filter_diff(diff, [r'\.aidl$'], [r'/aidl_api/']) + filtered = _filter_diff(diff, [r'\.aidl$'], [r'(^|/)aidl_api/']) if not filtered: return None aidl_format = options.tool_path('aidl-format') -- cgit v1.2.3