diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-01-10 15:19:44 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-01-10 15:19:44 +0000 |
commit | 7ada60e2c9c457e7f4db249e6e3169a7493aa8ee (patch) | |
tree | b56f97f4a66dad4d97468f9c298f07e793cb7d14 /clang-format | |
parent | d405bcad17de00fcb0b9cd1b64c9c90b9195ed5f (diff) |
Format what you can when errors are found
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@172075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-format')
-rw-r--r-- | clang-format/clang-format.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/clang-format/clang-format.py b/clang-format/clang-format.py index 49ba74b6..de922574 100644 --- a/clang-format/clang-format.py +++ b/clang-format/clang-format.py @@ -47,13 +47,14 @@ if stderr: message = parts[2] print 'Formatting failed: %s (total %d warnings, %d errors)' % ( message, stderr.count('warning:'), stderr.count('error:')) -else: - if not stdout: - print 'Segfault occurred. Please report to bugs.llvm.org.' - elif stdout != text: - lines = stdout.split('\n') - for i in range(min(len(buf), len(lines))): - buf[i] = lines[i] - for line in lines[len(buf):]: - buf.append(line) - del buf[len(lines):] + +if not stdout: + print ('No output from clang-format (crashed?).\n' + + 'Please report to bugs.llvm.org.') +elif stdout != text: + lines = stdout.split('\n') + for i in range(min(len(buf), len(lines))): + buf[i] = lines[i] + for line in lines[len(buf):]: + buf.append(line) + del buf[len(lines):] |