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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192184
91177308-0d34-0410-b5e6-
96231b3b80d8
return true;
}
if (Code->getBufferSize() == 0)
- return true; // Empty files are formatted correctly.
+ return false; // Empty files are formatted correctly.
FileID ID = createInMemoryFile(FileName, Code.get(), Sources, Files);
std::vector<CharSourceRange> Ranges;
if (fillRanges(Sources, ID, Code.get(), Ranges))
stdout, stderr = p.communicate()
if stderr:
print stderr
- return
+ if p.returncode != 0:
+ sys.exit(p.returncode);
if __name__ == '__main__':