summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-06-10 14:47:46 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-06-10 14:47:46 +0000
commit6c865749f6e92e52ea7dd3c0748e34c029fd8100 (patch)
tree8277a03aada949650fb7d9effcc18c6f6a41535d
parent3d74755d8ae3efe0ef073d8eb0a2a58d19db99ee (diff)
parent7842c78a5321c1ed4341ae6669d8081db8d72fdb (diff)
Merge "flag_check: use project name instead of project path to determine the project" into main
-rw-r--r--PREUPLOAD.cfg2
-rwxr-xr-xpackages/SystemUI/flag_check.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index b42f7bc0ca94..624a70833b03 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -30,4 +30,4 @@ ktfmt_hook = ${REPO_ROOT}/external/ktfmt/ktfmt.py --check -i ${REPO_ROOT}/framew
ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py --no-verify-format -f ${PREUPLOAD_FILES}
# This flag check hook runs only for "packages/SystemUI" subdirectory. If you want to include this check for other subdirectories, please modify flag_check.py.
-flag_hook = ${REPO_ROOT}/frameworks/base/packages/SystemUI/flag_check.py --msg=${PREUPLOAD_COMMIT_MESSAGE} --files=${PREUPLOAD_FILES} --project=${REPO_PATH}
+flag_hook = ${REPO_ROOT}/frameworks/base/packages/SystemUI/flag_check.py --msg=${PREUPLOAD_COMMIT_MESSAGE} --files=${PREUPLOAD_FILES} --project=${REPO_PROJECT}
diff --git a/packages/SystemUI/flag_check.py b/packages/SystemUI/flag_check.py
index bac3553e7498..a492864b11df 100755
--- a/packages/SystemUI/flag_check.py
+++ b/packages/SystemUI/flag_check.py
@@ -51,7 +51,7 @@ def main():
nargs='?',
default='',
help=
- 'REPO_PATH in repo upload to determine whether the check should run for this project.')
+ 'REPO_PROJECT in repo upload to determine whether the check should run for this project.')
# Parse the arguments
args = parser.parse_args()
@@ -108,16 +108,16 @@ def main():
sys.exit(0)
-def should_run_path(path, files):
+def should_run_path(project, files):
"""Returns a boolean if this check should run with these paths.
If you want to check for a particular subdirectory under the path,
add a check here, call should_run_files and check for a specific sub dir path in should_run_files.
"""
- if not path:
+ if not project:
return False
- if path == 'frameworks/base':
+ if project == 'platform/frameworks/base':
return should_run_files(files)
- # Default case, run for all other paths which calls this script.
+ # Default case, run for all other projects which calls this script.
return True