From 8f761f57958a1affcc2752f48ba5e5edf8dc1042 Mon Sep 17 00:00:00 2001 From: Daniel Cheng Date: Wed, 18 Oct 2023 19:12:46 +0000 Subject: [PATCH] Mention updating inclusive language excluded directories for 3p code. In an ideal world, exclusions to this check would never be needed, but for third-party code, fixing this can often be non-trivial (e.g. it might involve renaming git branches and fixing CI infrastructure). Change-Id: I7e27f5a65fce0d8356765b58474c23321d1cf361 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4944933 Reviewed-by: Josip Sokcevic Commit-Queue: Daniel Cheng --- presubmit_canned_checks.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index b5f61d5c09..a6d763df6f 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -2407,8 +2407,10 @@ def CheckInclusiveLanguage(input_api, warnings.extend(problems) excluded_paths = [] + excluded_directories_relative_path = input_api.os_path.join( + *excluded_directories_relative_path) dirs_file_path = input_api.os_path.join(input_api.change.RepositoryRoot(), - *excluded_directories_relative_path) + excluded_directories_relative_path) f = input_api.ReadFile(dirs_file_path) for line in f.splitlines(): @@ -2428,12 +2430,16 @@ def CheckInclusiveLanguage(input_api, if (warnings): result.append( output_api.PresubmitPromptWarning( - 'Banned non-inclusive language was used.\n' + + 'Banned non-inclusive language was used.\n\n' + + 'If this is third-party code, please consider updating ' + + excluded_directories_relative_path + ' if appropriate.\n\n' + '\n'.join(warnings))) if (errors): result.append( output_api.PresubmitError( - 'Banned non-inclusive language was used.\n' + + 'Banned non-inclusive language was used.\n\n' + + 'If this is third-party code, please consider updating ' + + excluded_directories_relative_path + ' if appropriate.\n\n' + '\n'.join(errors))) return result