Force Python 3 in presubmit

BUG=tint:1020

Change-Id: I8c4dba4367076922bd4dd039b1d91960eaf224a3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58940
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ryan Harrison 2021-07-20 17:16:31 +00:00 committed by Tint LUCI CQ
parent 9889ff0bcd
commit 6d27f23451
1 changed files with 19 additions and 14 deletions

View File

@ -18,6 +18,8 @@ for more details about the presubmit API built into depot_tools.
import re import re
USE_PYTHON3 = True
def _LicenseHeader(input_api): def _LicenseHeader(input_api):
"""Returns the license header regexp.""" """Returns the license header regexp."""
@ -109,12 +111,15 @@ def CheckNonInclusiveLanguage(input_api, output_api, source_file_filter=None):
for reg in REGEX_LIST: for reg in REGEX_LIST:
match = reg.search(line) match = reg.search(line)
if match: if match:
matches.append("{} ({}): found non-inclusive language: {}". matches.append(
format(f.LocalPath(), line_num, match.group(0))) "{} ({}): found non-inclusive language: {}".format(
f.LocalPath(), line_num, match.group(0)))
if len(matches): if len(matches):
return [output_api.PresubmitPromptWarning( return [
'Non-inclusive language found:', items=matches)] output_api.PresubmitPromptWarning('Non-inclusive language found:',
items=matches)
]
return [] return []