Commit 5573df14 authored by techtonik@gmail.com's avatar techtonik@gmail.com

Check for clang-format only if its files are present

R=agable@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1880013002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299867 0039d316-1c4b-4281-b951-d872f2087c98
parent d03bc634
......@@ -4461,17 +4461,17 @@ def CMDformat(parser, args):
top_dir = os.path.normpath(
RunGit(["rev-parse", "--show-toplevel"]).rstrip('\n'))
# Locate the clang-format binary in the checkout
try:
clang_format_tool = clang_format.FindClangFormatToolInChromiumTree()
except clang_format.NotFoundError, e:
DieWithError(e)
# Set to 2 to signal to CheckPatchFormatted() that this patch isn't
# formatted. This is used to block during the presubmit.
return_value = 0
if clang_diff_files:
# Locate the clang-format binary in the checkout
try:
clang_format_tool = clang_format.FindClangFormatToolInChromiumTree()
except clang_format.NotFoundError, e:
DieWithError(e)
if opts.full:
cmd = [clang_format_tool]
if not opts.dry_run and not opts.diff:
......
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