[Insight-developers] KWStyle run on Code/IO and Code/Numerics

Bill Lorensen bill.lorensen at gmail.com
Fri Mar 23 10:12:37 EST 2007


Julien,,
First of all, KWStyle is really great and will help us create itk code with
consistent style.

Lately (you may have noticed) I've used KWStyle (I always use the cvs
version) to correct the style in files in Code/IO and and Code/Numerics. For
the most part, KWStyle worked great.

I have noticed a few problems though.

1) KWStyle wants enums in a .h file to have m_ prefixes. This is incorrect.
Lots of examples of this in Code/IO.

2) In switch statements, if "default": is not the last switch state, KWStyle
gets confused about indentation. Examples: lines 476, 1048 and 1113 in
itkNrrdImageIO.cxx and lines 191, 980 and 1095 in itkMetaImageIO.cxx.

3) itkGDCMImageIO.cxx has some #ifdef's that mess up KWStyle's indentation.
Run KWStyle on this file and you'll see the challenges.

4) itkIPLFileNameLists.h has some classs definitions inside a class. This
seems to confuse KWStyle. Run KWStyle on this file.

5) itkMetaArrayReader.h line 127 and 211 indentations suggested by KWStyle
are not correct.

6) for(;;) KWStyle reports a repeated ";". Numerics/itkLBFGSBOptimizer.cxx

There are a few other scattered examples. You should run KWStyle on all the
files in IO and Numerics (only top level).


It would be neat if KWStyle could optionally correct the style errors and
write a corrected file to stdout. I spent a lot of time removing extra white
space and replacing " ;" with ";".

Finally, KWStyle is riot quite ready to be used as a commit check.

Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20070323/4ebca87a/attachment.htm


More information about the Insight-developers mailing list