<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 17, 2014 at 5:58 AM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Alex,<div class="gmail_extra"><br><div class="gmail_quote">
<div class="">On Thu, Jan 10, 2013 at 7:06 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: alexfh<br>
Date: Thu Jan 10 09:06:57 2013<br>
New Revision: 172072<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=172072&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=172072&view=rev</a><br>
Log:<br>
Improved clang-format integration support for diagnostic messages output<br>
<br>
Modified:<br>
    clang-tools-extra/trunk/clang-format/clang-format.py<br>
<br>
Modified: clang-tools-extra/trunk/clang-format/clang-format.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/clang-format.py?rev=172072&r1=172071&r2=172072&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/clang-format.py?rev=172072&r1=172071&r2=172072&view=diff</a><br>


==============================================================================<br>
--- clang-tools-extra/trunk/clang-format/clang-format.py (original)<br>
+++ clang-tools-extra/trunk/clang-format/clang-format.py Thu Jan 10 09:06:57 2013<br>
@@ -41,7 +41,12 @@<br>
<br>
 # If successful, replace buffer contents.<br>
 if stderr:<br>
-  print stderr<br>
+  message = stderr.splitlines()[0]<br>
+  parts = message.split(' ', 2)<br>
+  if len(parts) > 2:<br>
+    message = parts[2]<br></blockquote><div><br></div></div><div>Do you remember why the "message.split()' part (and the if) is here? If I use -style=file without a .clang-format file, clang-format prints "Can't find usable .clang-format, using LLVM style" (which makes sense), which this code transforms into "Formatting failed: usable .clang-format, using LLVM style (total 0 warnings, 0 errors)" (which is pretty confusing). Did clang-format used to print a prefix in front of errors?</div>
</div></div></div></blockquote><div><br></div><div>Yes, clang-format used to use DiagnosticEngine to ouput errors: <a href="http://llvm.org/viewvc/llvm-project?view=revision&revision=172071">http://llvm.org/viewvc/llvm-project?view=revision&revision=172071</a>. Now it doesn't output diagnostics and this code is obsolete.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div>Can the 3 lines above just go away?</div></div></div></div></blockquote><div> </div><div>Feel free to remove them.</div></div>
</div></div>