Commit f7c5c6d8 authored by Edward Lesmes's avatar Edward Lesmes Committed by Commit Bot

Make it possible to skip CheckTranslationScreenshots presubmit check.

We want to turn CheckTranslationScreenshots into an error, but allow
developers to skip it without skipping all presubmit tests (e.g. because
they are external contributors and don't have access to the images).

We make it possible to skip this check by setting
`Skip-Translation-Screenshots-Check: True` as a git footer. See this
commit message as an example.

Bug: 1082901
Skip-Translation-Screenshots-Check: True
Change-Id: I3c6572b59611ba7cfd2da4a6498b973d8e0e2233
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2203180Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769045}
parent 8db08f84
......@@ -4833,6 +4833,17 @@ def CheckChangeOnCommit(input_api, output_api):
def _CheckTranslationScreenshots(input_api, output_api):
# Skip translation screenshots check if a SkipTranslationScreenshotsCheck
# footer is set to true.
git_footers = input_api.change.GitFootersFromDescription()
skip_check = [
footer.lower()
for footer in git_footers.get(u'Skip-Translation-Screenshots-Check', [])]
if u'true' in skip_check:
return [
output_api.PresubmitPromptOrNotify(
'Skipping translation screenshots check.')]
import os
import sys
from io import StringIO
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment