mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
presubmit: fix git cl format failure in CheckPatchFormatted
CheckPatchFormatted passes the directory path of a given input file to `git cl format` command if the directory doesn't directly contain PRESUBMIT.py. Now the presubmit check uses a diff file which includes a full list of files to check the format of, and passing the directory is no longer necessary. Bug: 449775904 Change-Id: I50cdd58f46d058bbf5274f926578572573d814cc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7018893 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Scott Lee <ddoman@chromium.org>
This commit is contained in:
@@ -1878,12 +1878,6 @@ def CheckPatchFormatted(input_api,
|
||||
input_api.PresubmitLocalPath(), input_api.change.RepositoryRoot())
|
||||
if presubmit_subdir.startswith('..') or presubmit_subdir == '.':
|
||||
presubmit_subdir = ''
|
||||
# If the PRESUBMIT.py is in a parent repository, then format the entire
|
||||
# subrepository. Otherwise, format only the code in the directory that
|
||||
# contains the PRESUBMIT.py.
|
||||
if presubmit_subdir:
|
||||
cmd.append(input_api.PresubmitLocalPath())
|
||||
|
||||
code, _ = git_cl.RunGitWithCode(cmd, suppress_stderr=bypass_warnings)
|
||||
# bypass_warnings? Only fail with code 2.
|
||||
# As this is just a warning, ignore all other errors if the user
|
||||
|
||||
Reference in New Issue
Block a user