<br><br><div class="gmail_quote">On Tue, May 29, 2012 at 8:38 PM, reed kotler <span dir="ltr"><<a href="mailto:rkotler@mips.com" target="_blank">rkotler@mips.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div bgcolor="#ffffff" text="#000000"><div class="im">
On 05/29/2012 08:32 PM, David Blaikie wrote:
<blockquote type="cite">
<br>
<br>
<div class="gmail_quote">On Tue, May 29, 2012 at 8:26 PM, reed
kotler <span dir="ltr"><<a 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">
I made this simple python script to check for long lines and
lines with tabs.<br>
If it will be useful, I will add more of the style rules to
it.<br>
</blockquote>
<div><br>
</div>
<div>I can't speak for whether this is the sort of thing other
people will want added to the build, or the way it should be
done, but if it is/if you choose to use it yourself, it might
be good to add "trailing whitespace" as another thing to check
for.<br>
<br>
</div>
</div>
</blockquote></div>
I was going to add trailing whitespace check tomorrow. <br></div></blockquote><div><br></div><div>Sounds good - the other thing I didn't mention is integrating this into the build system(s - both make and cmake). I wouldn't worry about that until there's a bit more consensus, perhaps.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#ffffff" text="#000000"><div class="im">
<br>
<blockquote type="cite">
<div class="gmail_quote">
<div>[side note: to make such a check useful, we sort of would
need to have the codebase clean of violations to begin with
(or the tool would have to be smart enough to only flag based
on revision control-reported diffs) & some of the core
developers are a bit averse to making such a sweeping change
as it would taint the revision history for "svn blame"-like
tasks (though I don't think this is actually true - since both
svn and git can annotate/blame with whitespace ignorance.
Also, one of the problems with making the codebase clean is
that you can't then keep it clean - until you have a tool like
you've written/provided here, so perhaps that'll provide extra
motivation to do a full clean]</div>
</div>
</blockquote></div>
both git and svn have apis for doing more. if it's useful i can
expand there too.<br>
<br>
Would be also cool to add to clang directly many things which
require an AST in order to <br>
properly do. Many visual rules that we have for continuation lines
could be enforced for example<br>
without the need for human beings to check those things.<br>
<br>
Also, it would be possible to enforce global style conventions as
well as to allow override of<br>
them in c/c++ commants with a clang based tool.<br></div></blockquote><div><br></div><div>I believe that's the purpose of the clang-format tool that Manuel Klimek is working on. (doing good line wrapping/stylistic reinforcement). It would subsume some of your line wrap detection/fixing functionality, but I'm not sure it would do everything this script does/is intended to do.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#ffffff" text="#000000">
<br>
I hate doing work that robots should do and lots of the style
checking we do can be done by<br>
robots.</div></blockquote><div><br></div><div>Agreed.</div><div><br></div><div>- David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#ffffff" text="#000000">
<div class="im"><br>
<br>
<blockquote type="cite">
<div class="gmail_quote">
<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>
Default is 80 character maximum lines and checking for tabs.<br>
<br>
Usage: style_check.py arg1 arg2 ... argn [options]<br>
<br>
Options:<br>
-h, --help show this help message and exit<br>
--no-check-for-tabs don't check for tabs<br>
--no-check-line-length<br>
don't check line length<br>
--max-line-length=MAXLINELENGTH<br>
specify maximum line length<br>
</blockquote>
</div>
<br>
</blockquote>
<br>
</div></div>
</blockquote></div><br>