Chrome uses the syntax "Bug: xyz" in commit messages to attribute CLs
to bugs while Critique uses "BUG=xyz". As per
```
git log --grep '\(Bug\|Fixed\)=' --since=2021-01-01 --format=oneline \
| wc -l
```
we've had 27 CLs this year using the wrong syntax which led to crbug.com
not learning about the CLs <-> Bug attribution. Yours truly caused one
of them and wants to prevent the problem in the future.
We might relax the requirments in crbug.com or
chromium-review.googlesource.com but then anyone grepping through the
commit logs would need to deal with the ambiguity. Therefore, we can
just enforce the right syntax here.
https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/contributing.md
contains the correct syntax.
Change-Id: I60ee579deac50a74e1a014ceb1d9744cbc10ab41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3141567
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Dominic Battré <battre@chromium.org>
Also adds a new canned_presubmit_checks_test.py and supporting mocks,
based on the PRESUBMIT_*.py under chromium/src.
If this is OK, there are subsequent CLs for removing the original code
from chromuim/src and infra/infra, and having their PRESUBMIT scripts
just reference this canned check instead.
Change-Id: I67dfb7ac0b4cdc36bd62ec2dc062ca5c78c2244e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2805268
Commit-Queue: Sean McCullough <seanmccullough@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>