<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think I can adapt the script they have to llvm style guidelines
for C++.<br>
There can be a configuration file so various checking can be
optionally turned on/off.<br>
<br>
I will write one for tablegen files.<br>
<br>
What I'm thinking of is a scheme so that things can be configured on
a per directory basis.<br>
<br>
for example:<br>
<br>
there could be a .style_check file in a directory and it provides
the default<br>
<br>
similarly:<br>
<br>
.style_check.td provides further specialization for .td files<br>
.style_check.h provides further specialization for .h files<br>
<br>
<br>
this could also be configured in the makefiles.<br>
<br>
but the idea is to make some style checkers for various file types.<br>
<br>
initially .cpp/.h and .td.<br>
<br>
<br>
On 06/04/2012 03:22 PM, Chandler Carruth wrote:
<blockquote
cite="mid:CAGCO0KgOhxABygAQb2aJYKQk2ZO9owQDs-FHykzzJaTmF9hLmA@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="gmail_quote">On Mon, Jun 4, 2012 at 2:29 PM, reed
kotler <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:rkotler@mips.com" target="_blank">rkotler@mips.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Probably this has come up before... but have we considered
just adopting<br>
the Google style guidlines and maybe modifying it in some
places?<br>
</blockquote>
<div><br>
</div>
<div>Despite working at Google, and having to cope with multiple
different styles in my day-to-day work as a consequence, I
would not push for this.</div>
<div><br>
</div>
<div>I think that we should focus on building some consistency
of style and formatting within the LLVM/Clang/... codebases
rather than picking one style or another. Frankly, I just
don't care *what* the style is nearly as much as I care that
it is consistently applied.</div>
<div><br>
</div>
<div>I'll add minor points:</div>
<div><br>
</div>
<div>- I suspect LLVM/Clang/... have plenty of good reasons to
deviate from any existing style. We shouldn't constrain
ourselves to external guidelines at this point; these are
large healthy projects.</div>
<div><br>
</div>
<div>- We can fix any problems or inconsistencies with the style
guidelines if contributors can agree to what they are and what
would be a superior alternative.</div>
<div><br>
</div>
<div><br>
</div>
<div>Finally:</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">They have a nice script for c++ which will
check for many things.<br>
</blockquote>
<div><br>
</div>
<div>It is not a nice script. Trust me. I use it every day, and
I hate it with a burning, fiery passion. Read the python code.
It is not nice, it is terrible. It is an atrocity. It is
everything that is bad about trying to "parse" C++ with
regular expressions and python hacks, built up w/o any
overarching design or cohesion over years.</div>
<div><br>
</div>
<div>I await the day we can kill it off and use a real
Clang-based tool instead. </div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<br>
<a moz-do-not-send="true"
href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml"
target="_blank">http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml</a><br>
<br>
<a moz-do-not-send="true"
href="http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py"
target="_blank">http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py</a><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
<a moz-do-not-send="true"
href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a moz-do-not-send="true"
href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote>
</div>
<br>
</blockquote>
<br>
</body>
</html>