I am not opposed in principle. I say we have an opt-out mechanism for files. We initially opt everyone out and<div>start putting in files to test.</div><div><br></div><div> Matt<br><br><div class="gmail_quote">On Sat, Feb 27, 2010 at 9:59 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
What does everyone think of having a pretty printer automatically called at hg commit for .c and .h files in PETSc?<br>
<br>
I played with uncrustify and it looks pretty good. Just by changing its options I could reproduce much of the PETSc style guide and it is open source portable C++ so we could add addition features. For example, I cannot get it to respect keeping single line if () commands on that same line and I like to keep them on one line.<br>
<br>
Does anyone have experience with using pretty printers in this manner?<br>
<br>
Barry<br>
<br>
Note if we could get pretty printers coordinated in this way we could each have OUR OWN coding style and when we get files from a repository it comes into our style and when it goes out it goes back to the "standard" style. Then all of you won't have to live with my perverse ideas of what the code should look like in the editor. Basically convert to your style on loading into Emacs/VIM and convert back to standard on each save. The conversion has to be such that it does not introduce bogus changes to Mecurial, taking a file to your standard then back to PETSc's standard should not change it.<br>
<br>
Why would I even suggest this? Maybe it could be the first tiny step in moving away from thinking about source code as just a bunch of characters in a file to something that has a lot of internal structure we should take advantage of.<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>
</div>