diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-09-30 15:31:00 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-30 23:03:45 +0000 |
commit | 6541eebcf6b4424076466d10b147a9302d1856f7 (patch) | |
tree | 1811e6088e071735ec3259442d9daedd23e908b2 /PRESUBMIT.cfg | |
parent | 6cc74040193c715842941ea3c21ce6a7274b9329 (diff) | |
download | chrome-ec-6541eebcf6b4424076466d10b147a9302d1856f7.tar.gz |
zephyr: zmake: Add pre-upload formatter suggestions
Zmake requires three (fairly standard) formatting and linting tools to
preform validation on the source. At present, we run these as a part
of run_tests.sh and report it during the commit queue run, which can
be inconvenient to find out a CL needs trivial formatting changes
after you've already sent it to the CQ.
Running these formatting tools in pre-sumbit isn't exactly trivial:
some people run repo upload from outside of the chroot and we won't
necessarily have the formatting/linting tools installed, or if we do,
they could be different versions that make slightly different
suggestions. Therefore, we wrap the pre-upload logic like so:
- If no zmake changes were made, simply exit successfully.
- If we did make zmake changes, and we happen to be running in the
chroot, run the formatting tools and suggest fixes if necessary.
- Finally, if there's zmake changes but we're out of the chroot,
report a warning and fail the pre-upload checks.
BUG=b:192389533
BRANCH=none
TEST=(in chroot) try to upload a CL with bad formatting, get yelled at
during pre-upload
TEST=(out of chroot) upload a CL with zmake changes, get told to run
in the chroot
TEST=(out of chroot) try and upload without zmake changes, didn't
notice any pre-upload warnings
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: If307b9ce9f968b5b09ad8aeb27f4b9621e813036
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198244
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'PRESUBMIT.cfg')
-rw-r--r-- | PRESUBMIT.cfg | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/PRESUBMIT.cfg b/PRESUBMIT.cfg index 0cfaa932a9..edf886ab8c 100644 --- a/PRESUBMIT.cfg +++ b/PRESUBMIT.cfg @@ -26,3 +26,4 @@ presubmit_check = util/presubmit_check.sh config_option_check = util/config_option_check.py host_command_check = util/host_command_check.sh ec_commands_h = util/linux_ec_commands_h_check.sh +zmake_preupload = zephyr/zmake/pre-upload.sh ${PRESUBMIT_FILES} |