From ada543ed86dc4828cecdb937844c6468c872d3e3 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 1 Feb 2024 17:36:57 -0800 Subject: Print the modules that had strict_updatability_linting set strict_updatability_linting imposes requirements on all of a module's transitive dependencies. So you may start getting errors on a module due to some random other module that is hard to track down. Print out the modules that caused the current module to use strict updatability linting so that these errors are easier to debug. Ignore-AOSP-First: The lint code in internal has diverged from AOSP quite a bit now Bug: 323366771 Test: m lint-check Change-Id: I43f2b1adb1ffa5b6e9516694c2bb87c7f94fed7d --- scripts/lint_project_xml.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/lint_project_xml.py') diff --git a/scripts/lint_project_xml.py b/scripts/lint_project_xml.py index c40b07d38..cdc968aa9 100755 --- a/scripts/lint_project_xml.py +++ b/scripts/lint_project_xml.py @@ -77,6 +77,8 @@ def parse_args(): help='file containing merged manifest for the module and its dependencies.') parser.add_argument('--baseline', dest='baseline_path', help='file containing baseline lint issues.') + parser.add_argument('--strict_updatability_parents', + help='reverse dependencies that set strict_updatability_linting: true, for use in error messages') parser.add_argument('--library', dest='library', action='store_true', help='mark the module as a library.') parser.add_argument('--test', dest='test', action='store_true', @@ -161,8 +163,10 @@ def main(): baseline = minidom.parse(args.baseline_path) disallowed_issues = check_baseline_for_disallowed_issues(baseline, args.disallowed_issues) if disallowed_issues: - sys.exit('disallowed issues %s found in lint baseline file %s for module %s' - % (disallowed_issues, args.baseline_path, args.name)) + error_message = f'disallowed issues {disallowed_issues} found in lint baseline file {args.baseline_path} for module {args.name}' + if args.strict_updatability_parents: + error_message += f'. The parent modules that set strict_updatability_linting are {args.strict_updatability_parent}' + sys.exit(error_message) if args.project_out: with open(args.project_out, 'w') as f: -- cgit v1.2.3-59-g8ed1b