Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: git_cl.py

Issue 1880013002: Check for clang-format only if its files are present (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index b6d32d15a6a6c0448b6a7210e962c794b4de59c9..0c770cb58cf6b3127937cc53c87903006af04412 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -4440,17 +4440,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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698