diff options
author | Daniel Jasper <djasper@google.com> | 2013-10-08 15:54:36 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-10-08 15:54:36 +0000 |
commit | e8845ad4c5f8ae7b7775743d82f35cfd4c71e419 (patch) | |
tree | c7084e2baed679a8eced2c46e19d9f5c2bffda72 /clang/tools/clang-format/clang-format-diff.py | |
parent | 7f1146c4945a3bad3dafebd39cb62b97d6fbdd53 (diff) | |
download | bcm5719-llvm-e8845ad4c5f8ae7b7775743d82f35cfd4c71e419.tar.gz bcm5719-llvm-e8845ad4c5f8ae7b7775743d82f35cfd4c71e419.zip |
clang-format: Don't exit with failure on empty files.
Also let clang-format-diff.py detect errors based on clang-format's
return code. Otherwise messages like "Can't find usable .clang-format,
falling back to LLVM style" can make it fail, which might be undesired.
Patch by Alp Toker. Thank you!
llvm-svn: 192184
Diffstat (limited to 'clang/tools/clang-format/clang-format-diff.py')
-rwxr-xr-x | clang/tools/clang-format/clang-format-diff.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py index 90723d217b8..ca949b84ef9 100755 --- a/clang/tools/clang-format/clang-format-diff.py +++ b/clang/tools/clang-format/clang-format-diff.py @@ -81,7 +81,8 @@ def main(): stdout, stderr = p.communicate() if stderr: print stderr - return + if p.returncode != 0: + sys.exit(p.returncode); if __name__ == '__main__': |