[cfe-commits] [clang-tools-extra] r172072 - /clang-tools-extra/trunk/clang-format/clang-format.py

Nico Weber thakis at chromium.org
Wed Apr 16 20:58:24 PDT 2014


Hi Alex,

On Thu, Jan 10, 2013 at 7:06 AM, Alexander Kornienko <alexfh at google.com>wrote:

> Author: alexfh
> Date: Thu Jan 10 09:06:57 2013
> New Revision: 172072
>
> URL: http://llvm.org/viewvc/llvm-project?rev=172072&view=rev
> Log:
> Improved clang-format integration support for diagnostic messages output
>
> Modified:
>     clang-tools-extra/trunk/clang-format/clang-format.py
>
> Modified: clang-tools-extra/trunk/clang-format/clang-format.py
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/clang-format.py?rev=172072&r1=172071&r2=172072&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/clang-format/clang-format.py (original)
> +++ clang-tools-extra/trunk/clang-format/clang-format.py Thu Jan 10
> 09:06:57 2013
> @@ -41,7 +41,12 @@
>
>  # If successful, replace buffer contents.
>  if stderr:
> -  print stderr
> +  message = stderr.splitlines()[0]
> +  parts = message.split(' ', 2)
> +  if len(parts) > 2:
> +    message = parts[2]
>

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? Can the 3 lines
above just go away?


> +  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.'
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140416/21765d96/attachment.html>


More information about the cfe-commits mailing list