[petsc-dev] pretty printer for PETSc at commit?
knepley at gmail.com
Sat Feb 27 15:51:37 CST 2010
I am not opposed in principle. I say we have an opt-out mechanism for files.
We initially opt everyone out and
start putting in files to test.
On Sat, Feb 27, 2010 at 9:59 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> What does everyone think of having a pretty printer automatically called
> at hg commit for .c and .h files in PETSc?
> 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.
> Does anyone have experience with using pretty printers in this manner?
> 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.
> 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.
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the petsc-dev